aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Repository/EntriesRepository.php
diff options
context:
space:
mode:
authorNicolas Lœuillet <nicolas@loeuillet.org>2015-02-04 18:06:42 +0100
committerNicolas Lœuillet <nicolas@loeuillet.org>2015-02-04 18:06:42 +0100
commit6e334aba689f891a229c8a57f908f10dad5b3759 (patch)
treef6c8ceb5dd611a1f2d2c3c0fd48ed76890e27d31 /src/Wallabag/CoreBundle/Repository/EntriesRepository.php
parent42a9064620eb73eaa42928a22eeec86299d4a883 (diff)
downloadwallabag-6e334aba689f891a229c8a57f908f10dad5b3759.tar.gz
wallabag-6e334aba689f891a229c8a57f908f10dad5b3759.tar.zst
wallabag-6e334aba689f891a229c8a57f908f10dad5b3759.zip
for GET /api/entries, star, delete and archive status are no more necessary
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}