diff options
Diffstat (limited to 'src/Wallabag/CoreBundle/Repository')
-rw-r--r-- | src/Wallabag/CoreBundle/Repository/EntryRepository.php (renamed from src/Wallabag/CoreBundle/Repository/EntriesRepository.php) | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/Wallabag/CoreBundle/Repository/EntriesRepository.php b/src/Wallabag/CoreBundle/Repository/EntryRepository.php index ae854e5a..f4c803f9 100644 --- a/src/Wallabag/CoreBundle/Repository/EntriesRepository.php +++ b/src/Wallabag/CoreBundle/Repository/EntryRepository.php | |||
@@ -5,9 +5,8 @@ namespace Wallabag\CoreBundle\Repository; | |||
5 | use Doctrine\ORM\Query; | 5 | use Doctrine\ORM\Query; |
6 | use Doctrine\ORM\EntityRepository; | 6 | use Doctrine\ORM\EntityRepository; |
7 | use Doctrine\ORM\Tools\Pagination\Paginator; | 7 | use Doctrine\ORM\Tools\Pagination\Paginator; |
8 | use Wallabag\CoreBundle\Entity\Entries; | ||
9 | 8 | ||
10 | class EntriesRepository extends EntityRepository | 9 | class EntryRepository extends EntityRepository |
11 | { | 10 | { |
12 | /** | 11 | /** |
13 | * Retrieves unread entries for a user | 12 | * Retrieves unread entries for a user |
@@ -23,9 +22,9 @@ class EntriesRepository extends EntityRepository | |||
23 | ->select('e') | 22 | ->select('e') |
24 | ->setFirstResult($firstResult) | 23 | ->setFirstResult($firstResult) |
25 | ->setMaxResults($maxResults) | 24 | ->setMaxResults($maxResults) |
26 | ->where('e.isRead = 0') | 25 | ->where('e.isArchived = false') |
27 | ->andWhere('e.userId =:userId')->setParameter('userId', $userId) | 26 | ->andWhere('e.userId =:userId')->setParameter('userId', $userId) |
28 | ->andWhere('e.isDeleted=0') | 27 | ->andWhere('e.isDeleted=false') |
29 | ->orderBy('e.createdAt', 'desc') | 28 | ->orderBy('e.createdAt', 'desc') |
30 | ->getQuery(); | 29 | ->getQuery(); |
31 | 30 | ||
@@ -48,9 +47,9 @@ class EntriesRepository extends EntityRepository | |||
48 | ->select('e') | 47 | ->select('e') |
49 | ->setFirstResult($firstResult) | 48 | ->setFirstResult($firstResult) |
50 | ->setMaxResults($maxResults) | 49 | ->setMaxResults($maxResults) |
51 | ->where('e.isRead = 1') | 50 | ->where('e.isArchived = true') |
52 | ->andWhere('e.userId =:userId')->setParameter('userId', $userId) | 51 | ->andWhere('e.userId =:userId')->setParameter('userId', $userId) |
53 | ->andWhere('e.isDeleted=0') | 52 | ->andWhere('e.isDeleted=false') |
54 | ->orderBy('e.createdAt', 'desc') | 53 | ->orderBy('e.createdAt', 'desc') |
55 | ->getQuery(); | 54 | ->getQuery(); |
56 | 55 | ||
@@ -73,9 +72,9 @@ class EntriesRepository extends EntityRepository | |||
73 | ->select('e') | 72 | ->select('e') |
74 | ->setFirstResult($firstResult) | 73 | ->setFirstResult($firstResult) |
75 | ->setMaxResults($maxResults) | 74 | ->setMaxResults($maxResults) |
76 | ->where('e.isFav = 1') | 75 | ->where('e.isStarred = true') |
77 | ->andWhere('e.userId =:userId')->setParameter('userId', $userId) | 76 | ->andWhere('e.userId =:userId')->setParameter('userId', $userId) |
78 | ->andWhere('e.isDeleted=0') | 77 | ->andWhere('e.isDeleted=false') |
79 | ->orderBy('e.createdAt', 'desc') | 78 | ->orderBy('e.createdAt', 'desc') |
80 | ->getQuery(); | 79 | ->getQuery(); |
81 | 80 | ||
@@ -91,11 +90,11 @@ class EntriesRepository extends EntityRepository | |||
91 | ->where('e.userId =:userId')->setParameter('userId', $userId); | 90 | ->where('e.userId =:userId')->setParameter('userId', $userId); |
92 | 91 | ||
93 | if (!is_null($isArchived)) { | 92 | if (!is_null($isArchived)) { |
94 | $qb->andWhere('e.isRead =:isArchived')->setParameter('isArchived', $isArchived); | 93 | $qb->andWhere('e.isArchived =:isArchived')->setParameter('isArchived', $isArchived); |
95 | } | 94 | } |
96 | 95 | ||
97 | if (!is_null($isStarred)) { | 96 | if (!is_null($isStarred)) { |
98 | $qb->andWhere('e.isFav =:isStarred')->setParameter('isStarred', $isStarred); | 97 | $qb->andWhere('e.isStarred =:isStarred')->setParameter('isStarred', $isStarred); |
99 | } | 98 | } |
100 | 99 | ||
101 | if (!is_null($isDeleted)) { | 100 | if (!is_null($isDeleted)) { |