23,11 → 23,14 |
* @return array un tableau contenant les informations sur la personne. |
*/ |
public function getPersonne($id) { |
$url = $this->url_jrest.self::SERVICE_PERSONNE."/$id"; |
$json = file_get_contents($url); |
$donnees = json_decode($json, true); |
if ($donnees['nbElements'] == 1) { |
$donnees = $donnees['personnes'][0]; |
$donnees = array(); |
if (is_numeric($id)) { |
$url = $this->url_jrest.self::SERVICE_PERSONNE."/$id"; |
$json = file_get_contents($url); |
$donnees = json_decode($json, true); |
if ($donnees['nbElements'] == 1) { |
$donnees = $donnees['personnes'][0]; |
} |
} |
return $donnees; |
} |