Bläddra i källkod

Merge branch 'feature/amelioration_adresses' into develop

feature/export_comptable
Guillaume 4 år sedan
förälder
incheckning
8b0379c15d
1 ändrade filer med 16 tillägg och 1 borttagningar
  1. +16
    -1
      ShopBundle/Services/Utils.php

+ 16
- 1
ShopBundle/Services/Utils.php Visa fil

@@ -174,6 +174,15 @@ class Utils
return $truncate;
}

function stripAccents($stripAccents)
{
return strtr($stripAccents,'àáâãäçèéêëìíîïñòóôõöùúûüýÿÀÁÂÃÄÇÈÉÊËÌÍÎÏÑÒÓÔÕÖÙÚÛÜÝ','aaaaaceeeeiiiinooooouuuuyyAAAAACEEEEIIIINOOOOOUUUUY');
}

function cleanStringToCompare($string)
{
return $this->stripAccents(trim(strtolower($string))) ;
}

public function isBot()
{
@@ -296,7 +305,13 @@ class Utils
$provider = $this->getGeocoderProvider() ;;
$query = GeocodeQuery::create($query)->withData('type', 'housenumber');
$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)

Laddar…
Avbryt
Spara