12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- <?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]);
- }
- }
|