Conditions | 2 |
Paths | 2 |
Total Lines | 18 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
30 | public function loadAll(): array |
||
31 | { |
||
32 | $query = (new QueryBuilder()) |
||
33 | ->select('u.username AS v0', 'ug.identifier AS v1') |
||
34 | ->from('users', 'u') |
||
35 | ->innerJoin('users_user_groups', 'uug', 'uug.user_id = u.id AND uug.deleted_at IS NULL') |
||
36 | ->innerJoin('user_groups', 'ug', 'uug.user_group_id = ug.id AND ug.deleted_at IS NULL') |
||
37 | ->where('u.deleted_at IS NULL') |
||
38 | ; |
||
39 | |||
40 | $connection = $this->connectionPool->getReadConnection(); |
||
41 | $statement = $connection->prepare($query->getSql()); |
||
42 | $statement->bindValues($query->getParameters()); |
||
43 | if (!$statement->execute()) { |
||
44 | throw new Database($statement->errorInfo()); |
||
45 | } |
||
46 | |||
47 | return $statement->fetchAll(\PDO::FETCH_ASSOC); |
||
48 | } |
||
50 |