diff options
author | Jeremy Benoist <jeremy.benoist@gmail.com> | 2019-06-14 10:34:37 +0200 |
---|---|---|
committer | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2020-04-28 10:13:58 +0200 |
commit | 4bc6ef346ab28025d613d308da84812325f4c7ce (patch) | |
tree | 50da94e72eb4568e59b10d291054d532af95442e | |
parent | 6104e652ec8c8c72051f4e6763ae670d2ac099dc (diff) | |
download | wallabag-4bc6ef346ab28025d613d308da84812325f4c7ce.tar.gz wallabag-4bc6ef346ab28025d613d308da84812325f4c7ce.tar.zst wallabag-4bc6ef346ab28025d613d308da84812325f4c7ce.zip |
Fix `getBuilderForUntaggedByUser`
-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 | /** |