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