Created
December 20, 2013 20:45
-
-
Save pmjones/8061259 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace foo\bar; | |
use Aura\Marshal\Entity\MagicArrayAccessTrait; | |
use ArrayAccess; | |
class ArrayAccessEntityExample impelements ArrayAccess | |
{ | |
use MagicArrayAccessTrait; | |
protected $entity_data; | |
public function offsetExists($key) | |
{ | |
return array_key_exists($key, $this->entity_data); | |
} | |
public function offsetGet($key) | |
{ | |
return $this->entity_data[$key]; | |
} | |
public function offsetSet($key, $val) | |
{ | |
$this->entity_data[$key] = $val; | |
} | |
public function offsetUnset($key) | |
{ | |
unset($this->entity_data[$key]); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment