aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Repository/EntriesRepository.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/Wallabag/CoreBundle/Repository/EntriesRepository.php')
-rw-r--r--src/Wallabag/CoreBundle/Repository/EntriesRepository.php18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/Wallabag/CoreBundle/Repository/EntriesRepository.php b/src/Wallabag/CoreBundle/Repository/EntriesRepository.php
index c76b4215..aaca4251 100644
--- a/src/Wallabag/CoreBundle/Repository/EntriesRepository.php
+++ b/src/Wallabag/CoreBundle/Repository/EntriesRepository.php
@@ -86,13 +86,19 @@ class EntriesRepository extends EntityRepository
86 //TODO tous les paramètres ne sont pas utilisés, à corriger 86 //TODO tous les paramètres ne sont pas utilisés, à corriger
87 $qb = $this->createQueryBuilder('e') 87 $qb = $this->createQueryBuilder('e')
88 ->select('e') 88 ->select('e')
89 ->where('e.isFav =:isStarred')->setParameter('isStarred', $isStarred) 89 ->where('e.userId =:userId')->setParameter('userId', $userId)
90 ->andWhere('e.isRead =:isArchived')->setParameter('isArchived', $isArchived) 90 ->andWhere('e.isDeleted=0');
91 ->andWhere('e.userId =:userId')->setParameter('userId', $userId) 91
92 ->andWhere('e.isDeleted=0') 92 if (!is_null($isArchived)) {
93 $qb->andWhere('e.isRead =:isArchived')->setParameter('isArchived', $isArchived);
94 }
95
96 if (!is_null($isStarred)) {
97 $qb->andWhere('e.isFav =:isStarred')->setParameter('isStarred', $isStarred);
98 }
99
100 return $qb
93 ->getQuery() 101 ->getQuery()
94 ->getResult(Query::HYDRATE_ARRAY); 102 ->getResult(Query::HYDRATE_ARRAY);
95
96 return $qb;
97 } 103 }
98} 104}