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:
parent
a97e84a21e
commit
7e8a3c432f
5 changed files with 54 additions and 3 deletions
|
@ -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)
|
||||
;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue