Conditions | 1 |
Paths | 1 |
Total Lines | 11 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
45 | public function loadUserByAuthorizationRoles(array $roles) |
||
46 | { |
||
47 | $queryBuilder = $this->createQueryBuilder('o'); |
||
48 | $queryBuilder |
||
49 | ->join('o.authorizationRoles', 'a') |
||
50 | ->andWhere($queryBuilder->expr()->in('a.code', ':roles')) |
||
51 | ->setParameter('roles', $roles) |
||
52 | ; |
||
53 | |||
54 | return $queryBuilder->getQuery()->getResult(); |
||
55 | } |
||
56 | } |
||
57 |
If you implement
__call
and you know which methods are available, you can improve IDE auto-completion and static analysis by adding a @method annotation to the class.This is often the case, when
__call
is implemented by a parent class and only the child class knows which methods exist: