Conditions | 3 |
Paths | 4 |
Total Lines | 15 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 12 |
Changes | 0 |
1 | <?php |
||
49 | public function find(array $conditions): ?ArrayAccess |
||
50 | { |
||
51 | foreach ($conditions as $key => $value) { |
||
52 | unset($conditions[$key]); |
||
53 | $conditions[':' . $key] = $value; |
||
54 | } |
||
55 | |||
56 | $this->statement->execute($conditions); |
||
57 | $result = $this->statement->fetchAll(); |
||
58 | |||
59 | if (empty($result)) { |
||
60 | return null; |
||
61 | } |
||
62 | |||
63 | return new ArrayObject($result[0]); |
||
64 | } |
||
66 |