Conditions | 2 |
Paths | 2 |
Total Lines | 15 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
23 | 18 | protected function getAllIdsForFamilyQuery(User $user): string |
|
24 | { |
||
25 | 18 | if ($user->getOwner()) { |
|
26 | 9 | $id = $user->getOwner()->getId(); |
|
27 | } else { |
||
28 | 9 | $id = $user->getId(); |
|
29 | } |
||
30 | |||
31 | 18 | $connection = $this->getEntityManager()->getConnection(); |
|
32 | 18 | $qb = $connection->createQueryBuilder() |
|
33 | 18 | ->select('id') |
|
34 | 18 | ->from($connection->quoteIdentifier($this->getClassMetadata()->getTableName())) |
|
35 | 18 | ->andWhere('owner_id IN (SELECT id FROM user WHERE id = ' . $id . ' OR owner_id = ' . $id . ')'); |
|
36 | |||
37 | 18 | return $qb->getSQL(); |
|
38 | } |
||
54 |