1 | <?php |
||
31 | class PageIterator implements Page, \ArrayAccess, \JsonSerializable |
||
32 | { |
||
33 | /** |
||
34 | * @var Statement |
||
35 | */ |
||
36 | protected $statement; |
||
37 | |||
38 | protected $fetchStarted = false; |
||
39 | private $objectStorage; |
||
40 | private $className; |
||
41 | |||
42 | private $parentResult; |
||
43 | private $tdbmService; |
||
44 | private $magicSql; |
||
45 | private $parameters; |
||
46 | private $limit; |
||
47 | private $offset; |
||
48 | private $columnDescriptors; |
||
49 | private $magicQuery; |
||
50 | |||
51 | /** |
||
52 | * The key of the current retrieved object. |
||
53 | * |
||
54 | * @var int |
||
55 | */ |
||
56 | protected $key = -1; |
||
57 | |||
58 | protected $current = null; |
||
59 | |||
60 | private $databasePlatform; |
||
61 | |||
62 | private $innerResultIterator; |
||
63 | |||
64 | private $mode; |
||
65 | |||
66 | /** |
||
67 | * @var LoggerInterface |
||
68 | */ |
||
69 | private $logger; |
||
70 | |||
71 | public function __construct(ResultIterator $parentResult, $magicSql, array $parameters, $limit, $offset, array $columnDescriptors, $objectStorage, $className, TDBMService $tdbmService, MagicQuery $magicQuery, $mode, LoggerInterface $logger) |
||
87 | |||
88 | /** |
||
89 | * Retrieve an external iterator. |
||
90 | * |
||
91 | * @link http://php.net/manual/en/iteratoraggregate.getiterator.php |
||
92 | * |
||
93 | * @return InnerResultIterator An instance of an object implementing <b>Iterator</b> or |
||
94 | * <b>Traversable</b> |
||
95 | * |
||
96 | * @since 5.0.0 |
||
97 | */ |
||
98 | public function getIterator() |
||
110 | |||
111 | /** |
||
112 | * @return int |
||
113 | */ |
||
114 | public function getCurrentOffset() |
||
118 | |||
119 | /** |
||
120 | * @return int |
||
121 | */ |
||
122 | public function getCurrentPage() |
||
126 | |||
127 | /** |
||
128 | * @return int |
||
129 | */ |
||
130 | public function getCurrentLimit() |
||
134 | |||
135 | /** |
||
136 | * Return the number of results on the current page of the {@link Result}. |
||
137 | * |
||
138 | * @return int |
||
139 | */ |
||
140 | public function count() |
||
144 | |||
145 | /** |
||
146 | * Return the number of ALL results in the paginatable of {@link Result}. |
||
147 | * |
||
148 | * @return int |
||
149 | */ |
||
150 | public function totalCount() |
||
154 | |||
155 | /** |
||
156 | * Casts the result set to a PHP array. |
||
157 | * |
||
158 | * @return array |
||
159 | */ |
||
160 | public function toArray() |
||
164 | |||
165 | /** |
||
166 | * Returns a new iterator mapping any call using the $callable function. |
||
167 | * |
||
168 | * @param callable $callable |
||
169 | * |
||
170 | * @return MapIterator |
||
171 | */ |
||
172 | public function map(callable $callable) |
||
176 | |||
177 | /** |
||
178 | * Whether a offset exists. |
||
179 | * |
||
180 | * @link http://php.net/manual/en/arrayaccess.offsetexists.php |
||
181 | * |
||
182 | * @param mixed $offset <p> |
||
183 | * An offset to check for. |
||
184 | * </p> |
||
185 | * |
||
186 | * @return bool true on success or false on failure. |
||
187 | * </p> |
||
188 | * <p> |
||
189 | * The return value will be casted to boolean if non-boolean was returned |
||
190 | * |
||
191 | * @since 5.0.0 |
||
192 | */ |
||
193 | public function offsetExists($offset) |
||
197 | |||
198 | /** |
||
199 | * Offset to retrieve. |
||
200 | * |
||
201 | * @link http://php.net/manual/en/arrayaccess.offsetget.php |
||
202 | * |
||
203 | * @param mixed $offset <p> |
||
204 | * The offset to retrieve. |
||
205 | * </p> |
||
206 | * |
||
207 | * @return mixed Can return all value types |
||
208 | * |
||
209 | * @since 5.0.0 |
||
210 | */ |
||
211 | public function offsetGet($offset) |
||
215 | |||
216 | /** |
||
217 | * Offset to set. |
||
218 | * |
||
219 | * @link http://php.net/manual/en/arrayaccess.offsetset.php |
||
220 | * |
||
221 | * @param mixed $offset <p> |
||
222 | * The offset to assign the value to. |
||
223 | * </p> |
||
224 | * @param mixed $value <p> |
||
225 | * The value to set. |
||
226 | * </p> |
||
227 | * |
||
228 | * @since 5.0.0 |
||
229 | */ |
||
230 | public function offsetSet($offset, $value) |
||
234 | |||
235 | /** |
||
236 | * Offset to unset. |
||
237 | * |
||
238 | * @link http://php.net/manual/en/arrayaccess.offsetunset.php |
||
239 | * |
||
240 | * @param mixed $offset <p> |
||
241 | * The offset to unset. |
||
242 | * </p> |
||
243 | * |
||
244 | * @since 5.0.0 |
||
245 | */ |
||
246 | public function offsetUnset($offset) |
||
250 | |||
251 | /** |
||
252 | * Specify data which should be serialized to JSON. |
||
253 | * |
||
254 | * @link http://php.net/manual/en/jsonserializable.jsonserialize.php |
||
255 | * |
||
256 | * @return mixed data which can be serialized by <b>json_encode</b>, |
||
257 | * which is a value of any type other than a resource |
||
258 | * |
||
259 | * @since 5.4.0 |
||
260 | */ |
||
261 | public function jsonSerialize() |
||
267 | } |
||
268 |