getMany
Last updated Apr 6th, 2019 | 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
$301 per month—let's make that $500!
Learn morexPDOObject::getMany()¶
Gets a collection of objects related by aggregate or composite relations.
Syntax¶
API Docs: xPDOObject::getMany()
array &getMany (
string $alias,
[object $criteria = null],
[boolean|integer $cacheFlag = true]
)
Example¶
Get all the Chunks in a Category and output their names.
$category = $xpdo->getObject('Category',1);
$chunks = $category->getMany('Chunk');
foreach ($chunks as $chunk) {
echo $chunk->get('name').'<br />';
}
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
$301 per month—let's make that $500!
Learn more