aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/UserBundle/Repository/UserRepository.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/Wallabag/UserBundle/Repository/UserRepository.php')
-rw-r--r--src/Wallabag/UserBundle/Repository/UserRepository.php10
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}