1 | <?php |
||
6 | class ResultSet implements \Countable, \Iterator, \ArrayAccess |
||
7 | { |
||
8 | /** |
||
9 | * @var Result[] |
||
10 | */ |
||
11 | private $results = array(); |
||
12 | |||
13 | /** |
||
14 | * @param Result $result |
||
15 | */ |
||
16 | public function addResult(Result $result) |
||
20 | |||
21 | /** |
||
22 | * @var int |
||
23 | */ |
||
24 | protected $currentIndex = 0; |
||
25 | |||
26 | /** |
||
27 | * Return the current element |
||
28 | * @link http://php.net/manual/en/iterator.current.php |
||
29 | * @return mixed Can return any type. |
||
30 | * @since 5.0.0 |
||
31 | */ |
||
32 | public function current() |
||
36 | /** |
||
37 | * Move forward to next element |
||
38 | * @link http://php.net/manual/en/iterator.next.php |
||
39 | * @return void Any returned value is ignored. |
||
40 | * @since 5.0.0 |
||
41 | */ |
||
42 | public function next() |
||
46 | /** |
||
47 | * Return the key of the current element |
||
48 | * @link http://php.net/manual/en/iterator.key.php |
||
49 | * @return mixed scalar on success, or null on failure. |
||
50 | * @since 5.0.0 |
||
51 | */ |
||
52 | public function key() |
||
56 | /** |
||
57 | * Checks if current position is valid |
||
58 | * @link http://php.net/manual/en/iterator.valid.php |
||
59 | * @return boolean The return value will be casted to boolean and then evaluated. |
||
60 | * Returns true on success or false on failure. |
||
61 | * @since 5.0.0 |
||
62 | */ |
||
63 | public function valid() |
||
68 | /** |
||
69 | * Rewind the Iterator to the first element |
||
70 | * @link http://php.net/manual/en/iterator.rewind.php |
||
71 | * @return void Any returned value is ignored. |
||
72 | * @since 5.0.0 |
||
73 | */ |
||
74 | public function rewind() |
||
78 | /** |
||
79 | * Whether a offset exists |
||
80 | * @link http://php.net/manual/en/arrayaccess.offsetexists.php |
||
81 | * @param mixed $offset <p> |
||
82 | * An offset to check for. |
||
83 | * </p> |
||
84 | * @return boolean true on success or false on failure. |
||
85 | * </p> |
||
86 | * <p> |
||
87 | * The return value will be casted to boolean if non-boolean was returned. |
||
88 | * @since 5.0.0 |
||
89 | */ |
||
90 | public function offsetExists($offset) |
||
94 | /** |
||
95 | * Offset to retrieve |
||
96 | * @link http://php.net/manual/en/arrayaccess.offsetget.php |
||
97 | * @param mixed $offset <p> |
||
98 | * The offset to retrieve. |
||
99 | * </p> |
||
100 | * @return Result |
||
101 | * @since 5.0.0 |
||
102 | */ |
||
103 | public function offsetGet($offset) |
||
107 | /** |
||
108 | * Offset to set |
||
109 | * @link http://php.net/manual/en/arrayaccess.offsetset.php |
||
110 | * @param mixed $offset <p> |
||
111 | * The offset to assign the value to. |
||
112 | * </p> |
||
113 | * @param Result $value <p> |
||
114 | * The value to set. |
||
115 | * </p> |
||
116 | * @throws \Exception |
||
117 | * @since 5.0.0 |
||
118 | */ |
||
119 | public function offsetSet($offset, $value) |
||
130 | /** |
||
131 | * Offset to unset |
||
132 | * @link http://php.net/manual/en/arrayaccess.offsetunset.php |
||
133 | * @param mixed $offset <p> |
||
134 | * The offset to unset. |
||
135 | * </p> |
||
136 | * @return void |
||
137 | * @since 5.0.0 |
||
138 | */ |
||
139 | public function offsetUnset($offset) |
||
145 | |||
146 | /** |
||
147 | * Count elements of an object |
||
148 | * @link http://php.net/manual/en/countable.count.php |
||
149 | * @return int The custom count as an integer. |
||
150 | * </p> |
||
151 | * <p> |
||
152 | * The return value is cast to an integer. |
||
153 | * @since 5.1.0 |
||
154 | */ |
||
155 | public function count() |
||
159 | } |