123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- <?php
- namespace RocketTheme\Toolbox\ArrayTraits;
- /**
- * Implements getters and setters.
- *
- * @package RocketTheme\Toolbox\ArrayTraits
- * @author RocketTheme
- * @license MIT
- */
- trait NestedArrayAccessWithGetters
- {
- use NestedArrayAccess;
- /**
- * Magic setter method
- *
- * @param mixed $offset Asset name value
- * @param mixed $value Asset value
- */
- public function __set($offset, $value)
- {
- $this->offsetSet($offset, $value);
- }
- /**
- * Magic getter method
- *
- * @param mixed $offset Asset name value
- * @return mixed Asset value
- */
- public function __get($offset)
- {
- return $this->offsetGet($offset);
- }
- /**
- * Magic method to determine if the attribute is set
- *
- * @param mixed $offset Asset name value
- * @return boolean True if the value is set
- */
- public function __isset($offset)
- {
- return $this->offsetExists($offset);
- }
- /**
- * Magic method to unset the attribute
- *
- * @param mixed $offset The name value to unset
- */
- public function __unset($offset)
- {
- $this->offsetUnset($offset);
- }
- }
|