public function offsetGet($offset) { if (0 === $offset) { return $this->getLatitude(); } if (1 === $offset) { return $this->getLongitude(); } throw new \UnexpectedValueException("Cannot get Geopoint data with offset [{$offset}]"); }