xPDO.addDerivativeCriteria
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::addDerivativeCriteria¶
Adds a class_key condition to criteria for classes that use single-table inheritance. When a parent class is marked inherit="single", its derivative classes are stored in the same table and distinguished by class_key; this method ensures queries against the parent only return rows of the requested class.
Syntax¶
mixed addDerivativeCriteria (string $className, mixed $criteria)
Example¶
$criteria = $xpdo->addDerivativeCriteria('modResource', array('parent' => 12));
$resources = $xpdo->getCollection('modResource', $criteria);
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










