diff options
author | Thomas Citharel <tcit@tcit.fr> | 2017-04-27 19:17:19 +0200 |
---|---|---|
committer | Thomas Citharel <tcit@tcit.fr> | 2017-06-23 09:27:23 +0200 |
commit | 5847dd3572caf06c0e0d5e307241c3b6bc3f8611 (patch) | |
tree | 8905d4de388dd18239ea323f4650ff0070064eab /src/Wallabag/UserBundle/Repository/UserRepository.php | |
parent | 2585953e0dae631b65c59b0e31196d65bdde84df (diff) | |
download | wallabag-5847dd3572caf06c0e0d5e307241c3b6bc3f8611.tar.gz wallabag-5847dd3572caf06c0e0d5e307241c3b6bc3f8611.tar.zst wallabag-5847dd3572caf06c0e0d5e307241c3b6bc3f8611.zip |
MOAR WIP
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 | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/Wallabag/UserBundle/Repository/UserRepository.php b/src/Wallabag/UserBundle/Repository/UserRepository.php index 6adbe329..b4b13605 100644 --- a/src/Wallabag/UserBundle/Repository/UserRepository.php +++ b/src/Wallabag/UserBundle/Repository/UserRepository.php | |||
@@ -58,11 +58,19 @@ class UserRepository extends EntityRepository | |||
58 | * | 58 | * |
59 | * @param string $term | 59 | * @param string $term |
60 | * | 60 | * |
61 | * @return QueryBuilder | 61 | * @return \Doctrine\ORM\QueryBuilder |
62 | */ | 62 | */ |
63 | public function getQueryBuilderForSearch($term) | 63 | public function getQueryBuilderForSearch($term) |
64 | { | 64 | { |
65 | return $this->createQueryBuilder('u') | 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.'%'); | 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 | } | 67 | } |
68 | |||
69 | public function findGroupMembers($groupid) | ||
70 | { | ||
71 | return $this->createQueryBuilder('u') | ||
72 | ->leftJoin('u.userGroups', 'usergroup') | ||
73 | ->where('usergroup.group = :group')->setParameter(':group', $groupid) | ||
74 | ->andWhere('usergroup.accepted = true'); | ||
75 | } | ||
68 | } | 76 | } |