/** * Geocode the current full address * @return \Geocoder\Model\Address */ public function Geocode() { if (!$this->canBeGeolocalized()) { return false; } if ($this->owner->GeolocateOnLocation) { $result = Geocoder::geocodeAddress($this->getLocation()); } else { $result = Geocoder::geocodeAddress($this->getFormattedAddress()); } if ($result) { $this->owner->Latitude = $result->getLatitude(); $this->owner->Longitude = $result->getLongitude(); return $result; } return false; }