mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-17 15:03:25 +00:00
replaced repository methods with query-builder ones
This commit is contained in:
@@ -78,14 +78,16 @@ class SessionRepository extends EntityRepository
|
||||
* @param array $feed_id
|
||||
* @return Collection
|
||||
*/
|
||||
public function findByIdArray(array $feed_id)
|
||||
{
|
||||
$dql = 'SELECT f FROM Entities\Feed f
|
||||
ORDER BY f.created_on DESC
|
||||
WHERE f.id IN (' . implode(",", $feed_id) . ')';
|
||||
public function findByIds(array $feedIds)
|
||||
{
|
||||
$qb = $this->createQueryBuilder('f');
|
||||
|
||||
$query = $this->_em->createQuery($dql);
|
||||
|
||||
return $query->getResult();
|
||||
if (!empty($feedIds)) {
|
||||
$qb->Where($qb->expr()->in('f.id', $feedIds));
|
||||
}
|
||||
|
||||
$qb->orderBy('f.updated_on', 'DESC');
|
||||
|
||||
return $qb->getQuery()->getResult();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user