From: Jeremy Benoist Date: Fri, 14 Jun 2019 08:34:37 +0000 (+0200) Subject: Fix `getBuilderForUntaggedByUser` X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=4bc6ef346ab28025d613d308da84812325f4c7ce;p=github%2Fwallabag%2Fwallabag.git Fix `getBuilderForUntaggedByUser` --- diff --git a/src/Wallabag/CoreBundle/Repository/EntryRepository.php b/src/Wallabag/CoreBundle/Repository/EntryRepository.php index aa761df3..347e1b97 100644 --- a/src/Wallabag/CoreBundle/Repository/EntryRepository.php +++ b/src/Wallabag/CoreBundle/Repository/EntryRepository.php @@ -122,13 +122,17 @@ class EntryRepository extends EntityRepository /** * Retrieve a sorted list of untagged entries for a user. * - * @param int $userId + * @param int $userId + * @param string $sortBy Field to sort + * @param string $direction Direction of the order * * @return QueryBuilder */ - public function getBuilderForUntaggedByUser($userId) + public function getBuilderForUntaggedByUser($userId, $sortBy = 'starredAt', $direction = 'DESC') { - return $this->sortQueryBuilder($this->getRawBuilderForUntaggedByUser($userId)); + $sortBy = $sortBy ?: 'id'; + + return $this->sortQueryBuilder($this->getRawBuilderForUntaggedByUser($userId), $sortBy, $direction); } /**