1
0
Fork 0
mirror of https://github.com/wallabag/wallabag.git synced 2025-10-15 19:42:08 +00:00

Add sorting function to filter view

Fixes #2178

Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
This commit is contained in:
Kevin Decherf 2021-02-20 23:15:46 +01:00
parent a97e84a21e
commit 7e8a3c432f
5 changed files with 54 additions and 3 deletions

View file

@ -30,10 +30,11 @@ class EntryRepository extends ServiceEntityRepository
*
* @return QueryBuilder
*/
public function getBuilderForAllByUser($userId)
public function getBuilderForAllByUser($userId, $sortBy = 'createdAt', $direction = 'desc')
{
$sortBy = $sortBy ?: 'createdAt';
return $this
->getSortedQueryBuilderByUser($userId)
->getSortedQueryBuilderByUser($userId, $sortBy, $direction)
;
}