aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Repository/EntryRepository.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/Wallabag/CoreBundle/Repository/EntryRepository.php')
-rw-r--r--src/Wallabag/CoreBundle/Repository/EntryRepository.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/Wallabag/CoreBundle/Repository/EntryRepository.php b/src/Wallabag/CoreBundle/Repository/EntryRepository.php
index 4d45e5f5..4b607c81 100644
--- a/src/Wallabag/CoreBundle/Repository/EntryRepository.php
+++ b/src/Wallabag/CoreBundle/Repository/EntryRepository.php
@@ -95,7 +95,7 @@ class EntryRepository extends EntityRepository
95 * 95 *
96 * @return array 96 * @return array
97 */ 97 */
98 public function findEntries($userId, $isArchived = null, $isStarred = null, $sort = 'created', $order = 'ASC') 98 public function findEntries($userId, $isArchived = null, $isStarred = null, $sort = 'created', $order = 'ASC', $since = 0)
99 { 99 {
100 $qb = $this->createQueryBuilder('e') 100 $qb = $this->createQueryBuilder('e')
101 ->where('e.user =:userId')->setParameter('userId', $userId); 101 ->where('e.user =:userId')->setParameter('userId', $userId);
@@ -108,6 +108,10 @@ class EntryRepository extends EntityRepository
108 $qb->andWhere('e.isStarred =:isStarred')->setParameter('isStarred', (bool) $isStarred); 108 $qb->andWhere('e.isStarred =:isStarred')->setParameter('isStarred', (bool) $isStarred);
109 } 109 }
110 110
111 if ($since >= 0) {
112 $qb->andWhere('e.updatedAt > :since')->setParameter('since', new \DateTime(date('Y-m-d H:i:s', $since)));
113 }
114
111 if ('created' === $sort) { 115 if ('created' === $sort) {
112 $qb->orderBy('e.id', $order); 116 $qb->orderBy('e.id', $order);
113 } elseif ('updated' === $sort) { 117 } elseif ('updated' === $sort) {