]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/CoreBundle/Repository/EntryRepository.php
Entry: add sort parameter archived
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Repository / EntryRepository.php
index 34123eea699bff74a0ea1e7b126fd390a8b0dbf0..c0818ca09c4af9ba533e81a1f633e85c69db7b5d 100644 (file)
@@ -189,6 +189,8 @@ class EntryRepository extends EntityRepository
             $qb->orderBy('e.id', $order);
         } elseif ('updated' === $sort) {
             $qb->orderBy('e.updatedAt', $order);
+        } else if ('archived' === $sort) {
+            $qb->orderBy('e.archivedAt', $order);
         }
 
         $pagerAdapter = new DoctrineORMAdapter($qb, true, false);
@@ -450,7 +452,7 @@ class EntryRepository extends EntityRepository
      */
     private function getSortedQueryBuilderByUser($userId, $sortBy = 'createdAt', $direction = 'desc')
     {
-        return $this->sortQueryBuilder($this->getQueryBuilderByUser($userId));
+        return $this->sortQueryBuilder($this->getQueryBuilderByUser($userId), $sortBy, $direction);
     }
 
     /**