Skip to content

Commit 0237b0a

Browse files
authored
Merge pull request #1 from fdsis/master
Overwritable trait function
2 parents 2193d4c + bad7430 commit 0237b0a

2 files changed

Lines changed: 24 additions & 9 deletions

File tree

Classes/Domain/Model/GeoIndexableTrait.php

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -85,15 +85,7 @@ public function getLocationAddress() {
8585
* @param string $locationAddress
8686
*/
8787
public function setLocationAddress($locationAddress) {
88-
if (strlen($locationAddress) > 1) {
89-
$this->geoIndexService->indexAddress($locationAddress);
90-
$this->geoIndexService->setLocationDataOnObject($this);
91-
} else {
92-
$this->setLocationLabel('');
93-
$this->setLocationLatitude(NULL);
94-
$this->setLocationLongitude(NULL);
95-
$this->setLocationTimezone(NULL);
96-
}
88+
$this->onLocationChange($locationAddress);
9789
$this->locationAddress = $locationAddress;
9890
}
9991

@@ -155,6 +147,22 @@ public function setLocationTimezone($locationTimezone) {
155147
$this->locationTimezone = $locationTimezone;
156148
}
157149

150+
151+
/**
152+
* @param string $locationAddress
153+
*/
154+
protected function onLocationChange($locationAddress){
155+
if (strlen($locationAddress) > 1) {
156+
$this->geoIndexService->indexAddress($locationAddress);
157+
$this->geoIndexService->setLocationDataOnObject($this);
158+
} else {
159+
$this->setLocationLabel('');
160+
$this->setLocationLatitude(NULL);
161+
$this->setLocationLongitude(NULL);
162+
$this->setLocationTimezone(NULL);
163+
}
164+
}
165+
158166
}
159167

160168
?>

Classes/Service/GeoIndexService.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,5 +144,12 @@ public function getLatitude() {
144144
return NULL;
145145
}
146146

147+
/**
148+
* @return array
149+
*/
150+
public function getResultData(){
151+
return $this->resultData;
152+
}
153+
147154
}
148155
?>

0 commit comments

Comments
 (0)