|
|
|
|
|
|
|
|
return $result; |
|
|
return $result; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public function getZipByCity($city) |
|
|
|
|
|
|
|
|
public function getZipByCity($city, $code = null) |
|
|
{ |
|
|
{ |
|
|
$zip = null ; |
|
|
$zip = null ; |
|
|
$returnCitiesSearchZip = json_decode($this->callCitiesApi('get', 'communes', ['nom' => $city, 'fields' => 'nom,codesPostaux'])) ; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$paramsSearch = [ |
|
|
|
|
|
'nom' => $city, |
|
|
|
|
|
'fields' => 'nom,codesPostaux' |
|
|
|
|
|
] ; |
|
|
|
|
|
|
|
|
|
|
|
if($code != null && $code != 0) { |
|
|
|
|
|
$paramsSearch['code'] = $code ; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$returnCitiesSearchZip = json_decode($this->callCitiesApi('get', 'communes', $paramsSearch)) ; |
|
|
|
|
|
|
|
|
if($returnCitiesSearchZip) { |
|
|
if($returnCitiesSearchZip) { |
|
|
foreach($returnCitiesSearchZip as $citySearchZip) { |
|
|
foreach($returnCitiesSearchZip as $citySearchZip) { |