Conditions | 3 |
Paths | 4 |
Total Lines | 16 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php namespace Picqer\Financials\Exact\Query; |
||
33 | protected function collectionFromResult($result) |
||
34 | { |
||
35 | // If we have one result which is not an assoc array, make it the first element of an array for the |
||
36 | // collectionFromResult function so we always return a collection from filter |
||
37 | if ((bool) count(array_filter(array_keys($result), 'is_string'))) { |
||
38 | $result = [ $result ]; |
||
39 | } |
||
40 | |||
41 | $class = $this->class; |
||
42 | $collection = []; |
||
43 | |||
44 | foreach ($result as $r) { |
||
45 | $collection[] = new $class($this->connection, $r); |
||
46 | } |
||
47 | |||
48 | return $collection; |
||
49 | } |
||
51 |