1 | <?php |
||
17 | abstract class Collection extends ArrayObject implements Common |
||
18 | { |
||
19 | private $client; |
||
20 | |||
21 | private $loadStatus = 0; |
||
22 | |||
23 | private $fields = []; |
||
24 | |||
25 | private $class = null; |
||
26 | |||
27 | private $limit = null; |
||
28 | |||
29 | private $offset = null; |
||
30 | |||
31 | /** |
||
32 | * Collection constructor. |
||
33 | * @param Client $client |
||
34 | * @param array $fields |
||
35 | * @param string $class |
||
36 | * @param int $limit |
||
37 | * @param int $offset |
||
38 | * @throws Exception |
||
39 | */ |
||
40 | public function __construct(Client $client, array $fields, $class, $limit, $offset) |
||
63 | |||
64 | public function getIterator() |
||
68 | |||
69 | /** |
||
70 | * @param bool $force |
||
71 | * @return $this |
||
72 | */ |
||
73 | public function load($force = false) |
||
98 | |||
99 | /** |
||
100 | * @param int $limit |
||
101 | */ |
||
102 | public function setLimit($limit) |
||
110 | |||
111 | /** |
||
112 | * @param int $offset |
||
113 | */ |
||
114 | public function setOffset($offset) |
||
122 | |||
123 | /** |
||
124 | * @param array $data |
||
125 | * @return Model |
||
126 | */ |
||
127 | public function createModel(array $data = null) |
||
138 | |||
139 | public function count() { |
||
144 | |||
145 | public function getData() |
||
151 | |||
152 | public function reset() |
||
158 | |||
159 | public function end() |
||
165 | } |
This check marks implicit conversions of arrays to boolean values in a comparison. While in PHP an empty array is considered to be equal (but not identical) to false, this is not always apparent.
Consider making the comparison explicit by using
empty(..)
or! empty(...)
instead.