|
|
|
|
|
|
|
|
return $truncate; |
|
|
return $truncate; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function stripAccents($stripAccents) |
|
|
|
|
|
{ |
|
|
|
|
|
return strtr($stripAccents,'àáâãäçèéêëìíîïñòóôõöùúûüýÿÀÁÂÃÄÇÈÉÊËÌÍÎÏÑÒÓÔÕÖÙÚÛÜÝ','aaaaaceeeeiiiinooooouuuuyyAAAAACEEEEIIIINOOOOOUUUUY'); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function cleanStringToCompare($string) |
|
|
|
|
|
{ |
|
|
|
|
|
return $this->stripAccents(trim(strtolower($string))) ; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
public function isBot() |
|
|
public function isBot() |
|
|
{ |
|
|
{ |
|
|
|
|
|
|
|
|
$provider = $this->getGeocoderProvider() ;; |
|
|
$provider = $this->getGeocoderProvider() ;; |
|
|
$query = GeocodeQuery::create($query)->withData('type', 'housenumber'); |
|
|
$query = GeocodeQuery::create($query)->withData('type', 'housenumber'); |
|
|
$results = $provider->geocodeQuery($query); |
|
|
$results = $provider->geocodeQuery($query); |
|
|
return $results->all() ; |
|
|
|
|
|
|
|
|
$resultsToReturn = array(); |
|
|
|
|
|
foreach($results as $result) { |
|
|
|
|
|
if ($result->getStreetNumber() && strlen($result->getStreetNumber()) > 0) { |
|
|
|
|
|
$resultsToReturn[] = $result; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
return $resultsToReturn; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public function callReverseAddressApi($latitude, $longitude) |
|
|
public function callReverseAddressApi($latitude, $longitude) |