1 | <?php |
||
30 | class PageIterator implements Page, \ArrayAccess, \JsonSerializable |
||
31 | { |
||
32 | /** |
||
33 | * @var Statement |
||
34 | */ |
||
35 | protected $statement; |
||
36 | |||
37 | protected $fetchStarted = false; |
||
38 | private $objectStorage; |
||
39 | private $className; |
||
40 | |||
41 | private $parentResult; |
||
42 | private $tdbmService; |
||
43 | private $magicSql; |
||
44 | private $parameters; |
||
45 | private $limit; |
||
46 | private $offset; |
||
47 | private $columnDescriptors; |
||
48 | private $magicQuery; |
||
49 | |||
50 | /** |
||
51 | * The key of the current retrieved object. |
||
52 | * |
||
53 | * @var int |
||
54 | */ |
||
55 | protected $key = -1; |
||
56 | |||
57 | protected $current = null; |
||
58 | |||
59 | private $databasePlatform; |
||
60 | |||
61 | private $innerResultIterator; |
||
62 | |||
63 | private $mode; |
||
64 | |||
65 | public function __construct(ResultIterator $parentResult, $magicSql, array $parameters, $limit, $offset, array $columnDescriptors, $objectStorage, $className, TDBMService $tdbmService, MagicQuery $magicQuery, $mode) |
||
80 | |||
81 | /** |
||
82 | * Retrieve an external iterator. |
||
83 | * |
||
84 | * @link http://php.net/manual/en/iteratoraggregate.getiterator.php |
||
85 | * |
||
86 | * @return InnerResultIterator An instance of an object implementing <b>Iterator</b> or |
||
87 | * <b>Traversable</b> |
||
88 | * |
||
89 | * @since 5.0.0 |
||
90 | */ |
||
91 | public function getIterator() |
||
103 | |||
104 | /** |
||
105 | * @return int |
||
106 | */ |
||
107 | public function getCurrentOffset() |
||
111 | |||
112 | /** |
||
113 | * @return int |
||
114 | */ |
||
115 | public function getCurrentPage() |
||
119 | |||
120 | /** |
||
121 | * @return int |
||
122 | */ |
||
123 | public function getCurrentLimit() |
||
127 | |||
128 | /** |
||
129 | * Return the number of results on the current page of the {@link Result}. |
||
130 | * |
||
131 | * @return int |
||
132 | */ |
||
133 | public function count() |
||
137 | |||
138 | /** |
||
139 | * Return the number of ALL results in the paginatable of {@link Result}. |
||
140 | * |
||
141 | * @return int |
||
142 | */ |
||
143 | public function totalCount() |
||
147 | |||
148 | /** |
||
149 | * Casts the result set to a PHP array. |
||
150 | * |
||
151 | * @return array |
||
152 | */ |
||
153 | public function toArray() |
||
157 | |||
158 | /** |
||
159 | * Returns a new iterator mapping any call using the $callable function. |
||
160 | * |
||
161 | * @param callable $callable |
||
162 | * |
||
163 | * @return MapIterator |
||
164 | */ |
||
165 | public function map(callable $callable) |
||
169 | |||
170 | /** |
||
171 | * Whether a offset exists. |
||
172 | * |
||
173 | * @link http://php.net/manual/en/arrayaccess.offsetexists.php |
||
174 | * |
||
175 | * @param mixed $offset <p> |
||
176 | * An offset to check for. |
||
177 | * </p> |
||
178 | * |
||
179 | * @return bool true on success or false on failure. |
||
180 | * </p> |
||
181 | * <p> |
||
182 | * The return value will be casted to boolean if non-boolean was returned. |
||
183 | * |
||
184 | * @since 5.0.0 |
||
185 | */ |
||
186 | public function offsetExists($offset) |
||
190 | |||
191 | /** |
||
192 | * Offset to retrieve. |
||
193 | * |
||
194 | * @link http://php.net/manual/en/arrayaccess.offsetget.php |
||
195 | * |
||
196 | * @param mixed $offset <p> |
||
197 | * The offset to retrieve. |
||
198 | * </p> |
||
199 | * |
||
200 | * @return mixed Can return all value types. |
||
201 | * |
||
202 | * @since 5.0.0 |
||
203 | */ |
||
204 | public function offsetGet($offset) |
||
208 | |||
209 | /** |
||
210 | * Offset to set. |
||
211 | * |
||
212 | * @link http://php.net/manual/en/arrayaccess.offsetset.php |
||
213 | * |
||
214 | * @param mixed $offset <p> |
||
215 | * The offset to assign the value to. |
||
216 | * </p> |
||
217 | * @param mixed $value <p> |
||
218 | * The value to set. |
||
219 | * </p> |
||
220 | * |
||
221 | * @since 5.0.0 |
||
222 | */ |
||
223 | public function offsetSet($offset, $value) |
||
227 | |||
228 | /** |
||
229 | * Offset to unset. |
||
230 | * |
||
231 | * @link http://php.net/manual/en/arrayaccess.offsetunset.php |
||
232 | * |
||
233 | * @param mixed $offset <p> |
||
234 | * The offset to unset. |
||
235 | * </p> |
||
236 | * |
||
237 | * @since 5.0.0 |
||
238 | */ |
||
239 | public function offsetUnset($offset) |
||
243 | |||
244 | /** |
||
245 | * Specify data which should be serialized to JSON. |
||
246 | * |
||
247 | * @link http://php.net/manual/en/jsonserializable.jsonserialize.php |
||
248 | * |
||
249 | * @return mixed data which can be serialized by <b>json_encode</b>, |
||
250 | * which is a value of any type other than a resource. |
||
251 | * |
||
252 | * @since 5.4.0 |
||
253 | */ |
||
254 | public function jsonSerialize() |
||
260 | } |
||
261 |