Allow retrieve collection by a collection of base ids

This commit is contained in:
Benoît Burnichon
2016-03-17 16:54:27 +01:00
parent 8ca8f61726
commit 5ded48dafb
5 changed files with 80 additions and 12 deletions

View File

@@ -95,6 +95,25 @@ WHERE base_id = :baseId';
return null;
}
/**
* @param array $basesId
* @return CollectionReference[]
*/
public function findMany(array $basesId)
{
if (empty($basesId)) {
return [];
}
$rows = $this->connection->fetchAll(
self::$selectQuery . ' WHERE base_id IN (:baseIds)',
['baseIds' => $basesId],
['baseIds' => Connection::PARAM_INT_ARRAY]
);
return $this->createManyReferences($rows);
}
/**
* @param int $databoxId
* @param int $collectionId