mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-13 13:03:20 +00:00
add max_item and page in api route search and stories
This commit is contained in:
@@ -1677,17 +1677,20 @@ class record_adapter implements RecordInterface, cache_cacheableInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $offset
|
||||
* @param null|int $max_items
|
||||
*
|
||||
* @return set_selection|record_adapter[]
|
||||
* @throws Exception
|
||||
* @throws \Doctrine\DBAL\DBALException
|
||||
*/
|
||||
public function getChildren()
|
||||
public function getChildren($offset = 0, $max_items = null)
|
||||
{
|
||||
if (!$this->isStory()) {
|
||||
throw new Exception('This record is not a grouping');
|
||||
}
|
||||
|
||||
$selections = $this->getDatabox()->getRecordRepository()->findChildren([$this->getRecordId()]);
|
||||
$selections = $this->getDatabox()->getRecordRepository()->findChildren([$this->getRecordId()], null, $offset, $max_items);
|
||||
|
||||
return reset($selections);
|
||||
}
|
||||
|
Reference in New Issue
Block a user