| 1 | <?php |
||
| 7 | class ObjectContext implements \ArrayAccess |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * @var mixed |
||
| 11 | */ |
||
| 12 | private $object; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * @var \Symfony\Component\PropertyAccess\PropertyAccessor |
||
| 16 | */ |
||
| 17 | private $accessor; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * Constructor. |
||
| 21 | * |
||
| 22 | * @param mixed $object The object to extract data from. |
||
| 23 | */ |
||
| 24 | public function __construct($object) |
||
| 29 | |||
| 30 | /** |
||
| 31 | * Returns the object of the context. |
||
| 32 | * |
||
| 33 | * @return mixed |
||
| 34 | */ |
||
| 35 | public function getObject() |
||
| 39 | |||
| 40 | /** |
||
| 41 | * {@inheritdoc} |
||
| 42 | */ |
||
| 43 | public function offsetGet($id) |
||
| 53 | |||
| 54 | /** |
||
| 55 | * {@inheritdoc} |
||
| 56 | */ |
||
| 57 | public function offsetExists($id) |
||
| 61 | |||
| 62 | /** |
||
| 63 | * {@inheritdoc} |
||
| 64 | */ |
||
| 65 | public function offsetSet($id, $value) |
||
| 69 | |||
| 70 | /** |
||
| 71 | * {@inheritdoc} |
||
| 72 | */ |
||
| 73 | public function offsetUnset($id) |
||
| 77 | } |
||
| 78 |