X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FCoreBundle%2FRepository%2FEntryRepository.php;h=61be5220149771143f573aa27127fb461b9f9a6f;hb=1e7b04d4eada9b1a9064cbd8c9bf2de63ae63e76;hp=8704a2a6d2fb1062f3b17c2b36b016349c55d563;hpb=191564b7f71d01fb4c597c9b9641e23db564278d;p=github%2Fwallabag%2Fwallabag.git diff --git a/src/Wallabag/CoreBundle/Repository/EntryRepository.php b/src/Wallabag/CoreBundle/Repository/EntryRepository.php index 8704a2a6..61be5220 100644 --- a/src/Wallabag/CoreBundle/Repository/EntryRepository.php +++ b/src/Wallabag/CoreBundle/Repository/EntryRepository.php @@ -22,7 +22,7 @@ class EntryRepository extends EntityRepository return $this->createQueryBuilder('e') ->leftJoin('e.user', 'u') ->andWhere('u.id = :userId')->setParameter('userId', $userId) - ->orderBy('e.id', 'desc') + ->orderBy('e.createdAt', 'desc') ; } @@ -332,14 +332,15 @@ class EntryRepository extends EntityRepository /** * Remove all entries for a user id. - * Used when a user want to reset all informations + * Used when a user want to reset all informations. * - * @param int $userId + * @param int $userId */ public function removeAllByUserId($userId) { $this->getEntityManager() - ->createQuery('DELETE FROM Wallabag\CoreBundle\Entity\Entry e WHERE e.user = '.$userId) + ->createQuery('DELETE FROM Wallabag\CoreBundle\Entity\Entry e WHERE e.user = :userId') + ->setParameter('userId', $userId) ->execute(); } }