xPDO.getFKDefinition
Last updated not available | Page history | Improve this page | Report an issue
Support the team building MODX with a monthly donation.
The budget raised through OpenCollective is transparent, including payouts, and any contributor can apply to be paid for their work on MODX.
Backers
Budget
$185 per month—let's make that $500!
Learn morexPDO::getFKDefinition¶
Returns the definition of a single relationship — either an aggregate or a composite — for a class, identified by its relation alias. The returned array contains class, local, foreign, cardinality, and owner, plus a type key (aggregate or composite). Returns null if no definition is found, and logs an error.
Syntax¶
array|null getFKDefinition (string $parentClass, string $alias)
Example¶
$def = $xpdo->getFKDefinition('modResource', 'Template');
print_r($def);
// array('class' => 'MODX\Revolution\modTemplate', 'local' => 'template',
// 'foreign' => 'id', 'cardinality' => 'one', 'owner' => 'foreign',
// 'type' => 'aggregate')
See Also¶
Support the team building MODX with a monthly donation.
The budget raised through OpenCollective is transparent, including payouts, and any contributor can apply to be paid for their work on MODX.
Backers
Budget
$185 per month—let's make that $500!
Learn more










