Conditions | 2 |
Paths | 2 |
Total Lines | 20 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
1 | <?php |
||
8 | public function loadValidApis($accessMask, $keyType) |
||
9 | { |
||
10 | if ($keyType == 'Corporation') { |
||
11 | $corpRestriction = 'a.section = :corpSection'; |
||
12 | } else { |
||
13 | $corpRestriction = 'a.section <> :corpSection'; |
||
14 | } |
||
15 | |||
16 | $qb = $this->createQueryBuilder('a'); |
||
17 | $q = $qb->select('a') |
||
18 | ->where( |
||
19 | 'BIT_AND(a.mask, :accessMask) = a.mask |
||
20 | and ' . $corpRestriction |
||
21 | ) |
||
22 | ->getQuery() |
||
23 | ->setParameter('accessMask', $accessMask) |
||
24 | ->setParameter('corpSection', 'corp'); |
||
25 | |||
26 | return $q->getResult(); |
||
27 | } |
||
28 | |||
43 |