1 | <?php |
||
11 | class ArrayCollection implements Countable, IteratorAggregate, ArrayAccess, JsonSerializable |
||
12 | { |
||
13 | /** |
||
14 | * @var array |
||
15 | */ |
||
16 | protected $elements; |
||
17 | |||
18 | /** |
||
19 | * @param array $elements |
||
20 | */ |
||
21 | 8 | public function __construct(array $elements = []) |
|
25 | |||
26 | /** |
||
27 | * @return array |
||
28 | */ |
||
29 | public function toArray() |
||
33 | |||
34 | /** |
||
35 | * @return array |
||
36 | */ |
||
37 | public function jsonSerialize() |
||
41 | |||
42 | /** |
||
43 | * @param $key |
||
44 | * |
||
45 | * @return $this |
||
46 | */ |
||
47 | 1 | public function order($key) |
|
56 | |||
57 | /** |
||
58 | * @param $keys |
||
59 | * |
||
60 | * @return $this |
||
61 | */ |
||
62 | 1 | private function orderByChildCollection($keys) |
|
76 | |||
77 | /** |
||
78 | * @param $item |
||
79 | * @param $keys |
||
80 | * |
||
81 | * @return mixed|null |
||
82 | */ |
||
83 | 1 | private function getChildValueRecursive($item, $keys) |
|
109 | |||
110 | /** |
||
111 | * @param string $offset |
||
112 | * |
||
113 | * @return bool |
||
114 | */ |
||
115 | public function offsetExists($offset) |
||
119 | |||
120 | /** |
||
121 | * @param string $offset |
||
122 | * |
||
123 | * @return mixed |
||
124 | */ |
||
125 | public function offsetGet($offset) |
||
129 | |||
130 | /** |
||
131 | * @param string $offset |
||
132 | * @param mixed $value |
||
133 | */ |
||
134 | public function offsetSet($offset, $value) |
||
138 | |||
139 | /** |
||
140 | * @param string $offset |
||
141 | * |
||
142 | * @return null |
||
143 | */ |
||
144 | public function offsetUnset($offset) |
||
148 | |||
149 | /** |
||
150 | * @return int |
||
151 | */ |
||
152 | 5 | public function count() |
|
156 | |||
157 | /** |
||
158 | * @return ArrayIterator |
||
159 | */ |
||
160 | 1 | public function getIterator() |
|
164 | |||
165 | /** |
||
166 | * @param string $key |
||
167 | * |
||
168 | * @return null|mixed |
||
169 | */ |
||
170 | 2 | public function get($key) |
|
176 | |||
177 | /** |
||
178 | * @param string $key |
||
179 | * @param mixed $value |
||
180 | */ |
||
181 | public function set($key, $value) |
||
185 | |||
186 | /** |
||
187 | * @param mixed $value |
||
188 | * |
||
189 | * @return bool |
||
190 | */ |
||
191 | 8 | public function add($value) |
|
197 | |||
198 | /** |
||
199 | * @param string $key |
||
200 | * |
||
201 | * @return null|mixed |
||
202 | */ |
||
203 | public function remove($key) |
||
212 | } |
||
213 |