1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- <?php
- namespace yii\base;
- trait ArrayAccessTrait
- {
-
- public function getIterator()
- {
- return new \ArrayIterator($this->data);
- }
-
- public function count()
- {
- return count($this->data);
- }
-
- public function offsetExists($offset)
- {
- return isset($this->data[$offset]);
- }
-
- public function offsetGet($offset)
- {
- return isset($this->data[$offset]) ? $this->data[$offset] : null;
- }
-
- public function offsetSet($offset, $item)
- {
- $this->data[$offset] = $item;
- }
-
- public function offsetUnset($offset)
- {
- unset($this->data[$offset]);
- }
- }
|