Skip to content

Commit

Permalink
Merge pull request #1 from fdsis/master
Browse files Browse the repository at this point in the history
Overwritable trait function
  • Loading branch information
bweinzierl authored Sep 5, 2019
2 parents 2193d4c + bad7430 commit 0237b0a
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 9 deletions.
26 changes: 17 additions & 9 deletions Classes/Domain/Model/GeoIndexableTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,7 @@ public function getLocationAddress() {
* @param string $locationAddress
*/
public function setLocationAddress($locationAddress) {
if (strlen($locationAddress) > 1) {
$this->geoIndexService->indexAddress($locationAddress);
$this->geoIndexService->setLocationDataOnObject($this);
} else {
$this->setLocationLabel('');
$this->setLocationLatitude(NULL);
$this->setLocationLongitude(NULL);
$this->setLocationTimezone(NULL);
}
$this->onLocationChange($locationAddress);
$this->locationAddress = $locationAddress;
}

Expand Down Expand Up @@ -155,6 +147,22 @@ public function setLocationTimezone($locationTimezone) {
$this->locationTimezone = $locationTimezone;
}


/**
* @param string $locationAddress
*/
protected function onLocationChange($locationAddress){
if (strlen($locationAddress) > 1) {
$this->geoIndexService->indexAddress($locationAddress);
$this->geoIndexService->setLocationDataOnObject($this);
} else {
$this->setLocationLabel('');
$this->setLocationLatitude(NULL);
$this->setLocationLongitude(NULL);
$this->setLocationTimezone(NULL);
}
}

}

?>
7 changes: 7 additions & 0 deletions Classes/Service/GeoIndexService.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,5 +144,12 @@ public function getLatitude() {
return NULL;
}

/**
* @return array
*/
public function getResultData(){
return $this->resultData;
}

}
?>

0 comments on commit 0237b0a

Please sign in to comment.