1 | <?php |
||
19 | class ValuesContainer implements \ArrayAccess |
||
20 | { |
||
21 | /** |
||
22 | * The array that holds all the data collected by the object. |
||
23 | * |
||
24 | * @var mixed[] |
||
25 | */ |
||
26 | protected $data = array(); |
||
27 | |||
28 | /** |
||
29 | * Constructor |
||
30 | * |
||
31 | * @param mixed[]|null $data Any array of data used to initialize the object (optional) |
||
32 | */ |
||
33 | public function __construct($data = null) |
||
38 | |||
39 | /** |
||
40 | * Setter |
||
41 | * |
||
42 | * @param string|int $key |
||
43 | * @param string|int|bool|null|object $val |
||
44 | */ |
||
45 | public function __set($key, $val) |
||
49 | |||
50 | /** |
||
51 | * Getter |
||
52 | * |
||
53 | * @param string|int $key |
||
54 | * @return string|int|bool|null|object |
||
55 | */ |
||
56 | public function __get($key) |
||
63 | |||
64 | /** |
||
65 | * Tests if the key is set. |
||
66 | * |
||
67 | * @param string|int $key |
||
68 | * @return bool |
||
69 | */ |
||
70 | public function __isset($key) |
||
74 | |||
75 | /** |
||
76 | * Assigns a value to a certain offset. |
||
77 | * |
||
78 | * @param mixed|mixed[] $offset |
||
79 | */ |
||
80 | public function offsetSet($offset, $value) |
||
91 | |||
92 | /** |
||
93 | * Tests if an offeset key is set. |
||
94 | * |
||
95 | * @param string|int $offset |
||
96 | * @return bool |
||
97 | */ |
||
98 | public function offsetExists($offset) |
||
102 | |||
103 | /** |
||
104 | * Unsets a certain offeset key. |
||
105 | * |
||
106 | * @param string|int $offset |
||
107 | */ |
||
108 | public function offsetUnset($offset) |
||
112 | |||
113 | /** |
||
114 | * Returns the value associated to a certain offset. |
||
115 | * |
||
116 | * @param string|int $offset |
||
117 | * @return mixed|mixed[] |
||
118 | */ |
||
119 | public function offsetGet($offset) |
||
123 | } |