public function __get($property) { if ($this->hasMethod($method = "get{$property}")) { return $this->{$method}(); } elseif (isset($this->coordinates[$property])) { return $this->coordinates[$property]; } else { return parent::__get($property); } }