1 | <?php |
||
16 | class SearchIterator implements \Iterator |
||
17 | { |
||
18 | /** |
||
19 | * @var Search |
||
20 | */ |
||
21 | private $api; |
||
22 | |||
23 | /** |
||
24 | * @var array |
||
25 | */ |
||
26 | private $body; |
||
27 | |||
28 | /** |
||
29 | * @var string |
||
30 | */ |
||
31 | private $currentPage; |
||
32 | |||
33 | /** |
||
34 | * @var string |
||
35 | */ |
||
36 | private $nextPage; |
||
37 | |||
38 | /** |
||
39 | * @var integer |
||
40 | */ |
||
41 | private $key; |
||
42 | |||
43 | public function __construct(Search $api, array $body) |
||
49 | |||
50 | /** |
||
51 | * (PHP 5 >= 5.0.0)<br/> |
||
52 | * Return the current element |
||
53 | * @link http://php.net/manual/en/iterator.current.php |
||
54 | * @return mixed Can return any type. |
||
55 | */ |
||
56 | public function current() |
||
79 | |||
80 | /** |
||
81 | * (PHP 5 >= 5.0.0)<br/> |
||
82 | * Move forward to next element |
||
83 | * @link http://php.net/manual/en/iterator.next.php |
||
84 | * @return void Any returned value is ignored. |
||
85 | */ |
||
86 | public function next() |
||
91 | |||
92 | /** |
||
93 | * (PHP 5 >= 5.0.0)<br/> |
||
94 | * Return the key of the current element |
||
95 | * @link http://php.net/manual/en/iterator.key.php |
||
96 | * @return mixed scalar on success, or null on failure. |
||
97 | */ |
||
98 | public function key() |
||
102 | |||
103 | /** |
||
104 | * (PHP 5 >= 5.0.0)<br/> |
||
105 | * Checks if current position is valid |
||
106 | * @link http://php.net/manual/en/iterator.valid.php |
||
107 | * @return boolean The return value will be casted to boolean and then evaluated. |
||
108 | * Returns true on success or false on failure. |
||
109 | */ |
||
110 | public function valid() |
||
119 | |||
120 | /** |
||
121 | * (PHP 5 >= 5.0.0)<br/> |
||
122 | * Rewind the Iterator to the first element |
||
123 | * @link http://php.net/manual/en/iterator.rewind.php |
||
124 | * @return void Any returned value is ignored. |
||
125 | */ |
||
126 | public function rewind() |
||
132 | } |
||
133 |