]> git.immae.eu Git - github/wallabag/wallabag.git/blob - src/WallabagBundle/Repository/EntriesRepository.php
article view, fav list, archive list
[github/wallabag/wallabag.git] / src / WallabagBundle / Repository / EntriesRepository.php
1 <?php
2
3 namespace WallabagBundle\Repository;
4
5 use Doctrine\ORM\Query;
6 use Doctrine\ORM\EntityRepository;
7
8 /**
9 * EntriesRepository
10 *
11 * This class was generated by the Doctrine ORM. Add your own custom
12 * repository methods below.
13 */
14 class EntriesRepository extends EntityRepository
15 {
16 public function findUnreadByUser($userId)
17 {
18 $qb = $this->createQueryBuilder('e')
19 ->select('e')
20 ->where('e.isRead = 0')
21 ->andWhere('e.userId =:userId')->setParameter('userId', $userId)
22 ->getQuery()
23 ->getResult(Query::HYDRATE_ARRAY);
24
25 return $qb;
26 }
27
28 public function findArchiveByUser($userId)
29 {
30 $qb = $this->createQueryBuilder('e')
31 ->select('e')
32 ->where('e.isRead = 1')
33 ->andWhere('e.userId =:userId')->setParameter('userId', $userId)
34 ->getQuery()
35 ->getResult(Query::HYDRATE_ARRAY);
36
37 return $qb;
38 }
39
40 public function findStarredByUser($userId)
41 {
42 $qb = $this->createQueryBuilder('e')
43 ->select('e')
44 ->where('e.isFav = 1')
45 ->andWhere('e.userId =:userId')->setParameter('userId', $userId)
46 ->getQuery()
47 ->getResult(Query::HYDRATE_ARRAY);
48
49 return $qb;
50 }
51 }