Conditions | 2 |
Paths | 2 |
Total Lines | 18 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 4 |
CRAP Score | 3.0309 |
Changes | 0 |
1 | <?php |
||
30 | 3 | public function selectUsersByParams(Filter $filter):Query |
|
31 | { |
||
32 | 3 | $postsQuery = $this->createQueryBuilder('u'); |
|
33 | 3 | if ($filter->name) { |
|
34 | $postsQuery->where( |
||
35 | $postsQuery->expr()->like('u.firstName', ':name') |
||
36 | ) |
||
37 | ->orWhere( |
||
38 | $postsQuery->expr()->like('u.lastName', ':name') |
||
39 | ) |
||
40 | ->orWhere( |
||
41 | $postsQuery->expr()->like('u.email', ':name') |
||
42 | ) |
||
43 | ->setParameter('name', '%' . $filter->name . '%'); |
||
44 | } |
||
45 | |||
46 | 3 | return $postsQuery->getQuery(); |
|
47 | } |
||
48 | } |
||
49 |