diff --git a/Geolocation/AddressGeolocation.php b/Geolocation/AddressGeolocation.php index ab9be619..ac95d74c 100644 --- a/Geolocation/AddressGeolocation.php +++ b/Geolocation/AddressGeolocation.php @@ -14,7 +14,7 @@ /** * @author Olivier Chauvel */ -class AddressGeolocation implements \Serializable +class AddressGeolocation implements \Serializable, \ArrayAccess { private $address; private $latitude; @@ -77,4 +77,24 @@ public function unserialize($serialized) $this->locality = $data['locality'] ?: null; $this->country = $data['country'] ?: null; } + + public function offsetExists($offset) + { + return isset($this->$offset); + } + + public function offsetSet($offset, $value) + { + $this->$offset = $value; + } + + public function offsetGet($offset) + { + return $this->$offset; + } + + public function offsetUnset($offset) + { + $this->$offset = null; + } }