Jump to main content Jump to doc navigation

xPDOObject::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