]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/CoreBundle/Repository/EntriesRepository.php
change delete status for GET /api/entries method
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Repository / EntriesRepository.php
index aaca4251440eb84002781594738ccb366cfc45ef..dd92d5200426ee4c004513eaf1c2a90099d090fa 100644 (file)
@@ -86,8 +86,7 @@ class EntriesRepository extends EntityRepository
         //TODO tous les paramètres ne sont pas utilisés, à corriger
         $qb = $this->createQueryBuilder('e')
             ->select('e')
-            ->where('e.userId =:userId')->setParameter('userId', $userId)
-            ->andWhere('e.isDeleted=0');
+            ->where('e.userId =:userId')->setParameter('userId', $userId);
 
         if (!is_null($isArchived)) {
             $qb->andWhere('e.isRead =:isArchived')->setParameter('isArchived', $isArchived);
@@ -97,6 +96,10 @@ class EntriesRepository extends EntityRepository
             $qb->andWhere('e.isFav =:isStarred')->setParameter('isStarred', $isStarred);
         }
 
+        if (!is_null($isDeleted)) {
+            $qb->andWhere('e.isDeleted =:isDeleted')->setParameter('isDeleted', $isDeleted);
+        }
+
         return $qb
             ->getQuery()
             ->getResult(Query::HYDRATE_ARRAY);