3 namespace WallabagBundle\Repository
;
5 use Doctrine\ORM\Query
;
6 use Doctrine\ORM\EntityRepository
;
11 * This class was generated by the Doctrine ORM. Add your own custom
12 * repository methods below.
14 class EntriesRepository
extends EntityRepository
16 public function findUnreadByUser($userId)
18 $qb = $this->createQueryBuilder('e')
20 ->where('e.isRead = 0')
21 ->andWhere('e.userId =:userId')->setParameter('userId', $userId)
23 ->getResult(Query
::HYDRATE_ARRAY
);
28 public function findArchiveByUser($userId)
30 $qb = $this->createQueryBuilder('e')
32 ->where('e.isRead = 1')
33 ->andWhere('e.userId =:userId')->setParameter('userId', $userId)
35 ->getResult(Query
::HYDRATE_ARRAY
);
40 public function findStarredByUser($userId)
42 $qb = $this->createQueryBuilder('e')
44 ->where('e.isFav = 1')
45 ->andWhere('e.userId =:userId')->setParameter('userId', $userId)
47 ->getResult(Query
::HYDRATE_ARRAY
);