1
0
Fork 0
mirror of https://github.com/wallabag/wallabag.git synced 2025-10-05 19:31:02 +00:00

Add filter to users management page

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2017-04-27 15:58:32 +02:00 committed by Nicolas Lœuillet
parent e1d64050ad
commit c37515f880
17 changed files with 170 additions and 28 deletions

View file

@ -52,4 +52,19 @@ class UserRepository extends EntityRepository
->getQuery()
->getSingleScalarResult();
}
/**
* Retrieves users filtered with a search term.
*
* @param string $term
*
* @return QueryBuilder
*/
public function getUsersForSearch($term)
{
return $this->createQueryBuilder('u')
->andWhere('lower(u.username) LIKE lower(:term) OR lower(u.email) LIKE lower(:term) OR lower(u.name) LIKE lower(:term)')->setParameter('term', '%'.$term.'%')
->getQuery()
->getResult();
}
}