diff options
author | Thomas Citharel <tcit@tcit.fr> | 2017-05-04 14:35:14 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-04 14:35:14 +0200 |
commit | 6b76ae3d1f6a061237f983622b2d3708beded368 (patch) | |
tree | c0085b25c6ff8eec25f2b785cf985a8e95f25b09 /src/Wallabag/UserBundle/Repository | |
parent | 3b4502e0e663866e7bac00164fd935fdc92309d6 (diff) | |
parent | b5b6877976bc32f23e51c2fb0f3f973f0d571b10 (diff) | |
download | wallabag-6b76ae3d1f6a061237f983622b2d3708beded368.tar.gz wallabag-6b76ae3d1f6a061237f983622b2d3708beded368.tar.zst wallabag-6b76ae3d1f6a061237f983622b2d3708beded368.zip |
Merge pull request #3060 from wallabag/search-users
Search & paginate users
Diffstat (limited to 'src/Wallabag/UserBundle/Repository')
-rw-r--r-- | src/Wallabag/UserBundle/Repository/UserRepository.php | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/Wallabag/UserBundle/Repository/UserRepository.php b/src/Wallabag/UserBundle/Repository/UserRepository.php index f913f52d..6adbe329 100644 --- a/src/Wallabag/UserBundle/Repository/UserRepository.php +++ b/src/Wallabag/UserBundle/Repository/UserRepository.php | |||
@@ -52,4 +52,17 @@ 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 getQueryBuilderForSearch($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 | } | ||
55 | } | 68 | } |