aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/WallabagBundle/Repository/EntriesRepository.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/WallabagBundle/Repository/EntriesRepository.php')
-rw-r--r--src/WallabagBundle/Repository/EntriesRepository.php32
1 files changed, 24 insertions, 8 deletions
diff --git a/src/WallabagBundle/Repository/EntriesRepository.php b/src/WallabagBundle/Repository/EntriesRepository.php
index 4c13c9c2..c355a012 100644
--- a/src/WallabagBundle/Repository/EntriesRepository.php
+++ b/src/WallabagBundle/Repository/EntriesRepository.php
@@ -13,14 +13,6 @@ use Doctrine\ORM\EntityRepository;
13 */ 13 */
14class EntriesRepository extends EntityRepository 14class EntriesRepository extends EntityRepository
15{ 15{
16 /* public function findUnreadByUser($userId)
17 {
18 return $this->createQueryBuilder('e')
19 ->where('e.is_read = 0')
20 ->andWhere('e.user_id = :userId')
21 ->setParameter('userId', $userId)
22 ->getQuery();
23 }*/
24 public function findUnreadByUser($userId) 16 public function findUnreadByUser($userId)
25 { 17 {
26 $qb = $this->createQueryBuilder('e') 18 $qb = $this->createQueryBuilder('e')
@@ -32,4 +24,28 @@ class EntriesRepository extends EntityRepository
32 24
33 return $qb; 25 return $qb;
34 } 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 }
35} 51}