diff options
-rw-r--r-- | src/Wallabag/CoreBundle/Repository/EntryRepository.php | 10 |
1 files changed, 7 insertions, 3 deletions
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 | |||
122 | /** | 122 | /** |
123 | * Retrieve a sorted list of untagged entries for a user. | 123 | * Retrieve a sorted list of untagged entries for a user. |
124 | * | 124 | * |
125 | * @param int $userId | 125 | * @param int $userId |
126 | * @param string $sortBy Field to sort | ||
127 | * @param string $direction Direction of the order | ||
126 | * | 128 | * |
127 | * @return QueryBuilder | 129 | * @return QueryBuilder |
128 | */ | 130 | */ |
129 | public function getBuilderForUntaggedByUser($userId) | 131 | public function getBuilderForUntaggedByUser($userId, $sortBy = 'starredAt', $direction = 'DESC') |
130 | { | 132 | { |
131 | return $this->sortQueryBuilder($this->getRawBuilderForUntaggedByUser($userId)); | 133 | $sortBy = $sortBy ?: 'id'; |
134 | |||
135 | return $this->sortQueryBuilder($this->getRawBuilderForUntaggedByUser($userId), $sortBy, $direction); | ||
132 | } | 136 | } |
133 | 137 | ||
134 | /** | 138 | /** |