Conditions | 3 |
Paths | 4 |
Total Lines | 16 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
73 | protected function collectionFromResult($result) |
||
74 | { |
||
75 | // If we have one result which is not an assoc array, make it the first element of an array for the |
||
76 | // collectionFromResult function so we always return a collection from filter |
||
77 | if ((bool) count(array_filter(array_keys($result), 'is_string'))) { |
||
78 | $result = [$result]; |
||
79 | } |
||
80 | |||
81 | $class = $this->class; |
||
82 | $collection = []; |
||
83 | |||
84 | foreach ($result as $r) { |
||
85 | $collection[] = new $class($this->connection, $r); |
||
86 | } |
||
87 | |||
88 | return $collection; |
||
89 | } |
||
91 |