]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/CoreBundle/Repository/EntryRepository.php
CS
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Repository / EntryRepository.php
index 53e8e2ba1e1c717992a632f3f3b3973938f5f7d2..1335e808666bc05eb63042d84b080482d7dff368 100644 (file)
@@ -10,7 +10,7 @@ use Pagerfanta\Pagerfanta;
 class EntryRepository extends EntityRepository
 {
     /**
-     * Retrieves unread entries for a user
+     * Retrieves unread entries for a user.
      *
      * @param int $userId
      * @param int $firstResult
@@ -26,7 +26,7 @@ class EntryRepository extends EntityRepository
             ->leftJoin('e.user', 'u')
             ->where('e.isArchived = false')
             ->andWhere('u.id =:userId')->setParameter('userId', $userId)
-            ->orderBy('e.createdAt', 'desc')
+            ->orderBy('e.id', 'desc')
             ->getQuery();
 
         $paginator = new Paginator($qb);
@@ -35,7 +35,7 @@ class EntryRepository extends EntityRepository
     }
 
     /**
-     * Retrieves read entries for a user
+     * Retrieves read entries for a user.
      *
      * @param int $userId
      * @param int $firstResult
@@ -52,7 +52,7 @@ class EntryRepository extends EntityRepository
             ->leftJoin('e.user', 'u')
             ->where('e.isArchived = true')
             ->andWhere('u.id =:userId')->setParameter('userId', $userId)
-            ->orderBy('e.createdAt', 'desc')
+            ->orderBy('e.id', 'desc')
             ->getQuery();
 
         $paginator = new Paginator($qb);
@@ -61,7 +61,7 @@ class EntryRepository extends EntityRepository
     }
 
     /**
-     * Retrieves starred entries for a user
+     * Retrieves starred entries for a user.
      *
      * @param int $userId
      * @param int $firstResult
@@ -78,7 +78,7 @@ class EntryRepository extends EntityRepository
             ->leftJoin('e.user', 'u')
             ->where('e.isStarred = true')
             ->andWhere('u.id =:userId')->setParameter('userId', $userId)
-            ->orderBy('e.createdAt', 'desc')
+            ->orderBy('e.id', 'desc')
             ->getQuery();
 
         $paginator = new Paginator($qb);
@@ -87,7 +87,7 @@ class EntryRepository extends EntityRepository
     }
 
     /**
-     * Find Entries
+     * Find Entries.
      *
      * @param int    $userId
      * @param bool   $isArchived
@@ -111,7 +111,7 @@ class EntryRepository extends EntityRepository
         }
 
         if ('created' === $sort) {
-            $qb->orderBy('e.createdAt', $order);
+            $qb->orderBy('e.id', $order);
         } elseif ('updated' === $sort) {
             $qb->orderBy('e.updatedAt', $order);
         }