diff options
author | Thomas Citharel <tcit@tcit.fr> | 2017-04-27 15:58:32 +0200 |
---|---|---|
committer | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2017-05-02 15:28:39 +0200 |
commit | c37515f880bd05b86e3e848cc184018295ec1920 (patch) | |
tree | c64785ee1bce798fe05d6b06e63abff0a41ffcea /src/Wallabag/UserBundle/Repository/UserRepository.php | |
parent | e1d64050ad6f54e45d3954ffac21daaee58c6240 (diff) | |
download | wallabag-c37515f880bd05b86e3e848cc184018295ec1920.tar.gz wallabag-c37515f880bd05b86e3e848cc184018295ec1920.tar.zst wallabag-c37515f880bd05b86e3e848cc184018295ec1920.zip |
Add filter to users management page
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
Diffstat (limited to 'src/Wallabag/UserBundle/Repository/UserRepository.php')
-rw-r--r-- | src/Wallabag/UserBundle/Repository/UserRepository.php | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/Wallabag/UserBundle/Repository/UserRepository.php b/src/Wallabag/UserBundle/Repository/UserRepository.php index f913f52d..66bbab39 100644 --- a/src/Wallabag/UserBundle/Repository/UserRepository.php +++ b/src/Wallabag/UserBundle/Repository/UserRepository.php | |||
@@ -52,4 +52,19 @@ class UserRepository extends EntityRepository | |||
52 | ->getQuery() | 52 | ->getQuery() |
53 | ->getSingleScalarResult(); | 53 | ->getSingleScalarResult(); |
54 | } | 54 | } |
55 | |||
56 | /** | ||
57 | * Retrieves users filtered with a search term. | ||
58 | * | ||
59 | * @param string $term | ||
60 | * | ||
61 | * @return QueryBuilder | ||
62 | */ | ||
63 | public function getUsersForSearch($term) | ||
64 | { | ||
65 | return $this->createQueryBuilder('u') | ||
66 | ->andWhere('lower(u.username) LIKE lower(:term) OR lower(u.email) LIKE lower(:term) OR lower(u.name) LIKE lower(:term)')->setParameter('term', '%'.$term.'%') | ||
67 | ->getQuery() | ||
68 | ->getResult(); | ||
69 | } | ||
55 | } | 70 | } |