50,6 → 50,23 |
return $corps; |
} |
|
public function modifier($ressources, $parametres) { |
$this->methode = 'modifier'; |
$resultat = ''; |
$reponseHttp = new ReponseHttp(); |
try { |
$this->initialiserRessourcesEtParametres($ressources, $parametres); |
$this->conteneur = new Conteneur($this->parametres); |
$resultat = $this->traiterRessources(); |
$reponseHttp->setResultatService($resultat); |
} catch (Exception $e) { |
$reponseHttp->ajouterErreur($e); |
} |
$reponseHttp->emettreLesEntetes(); |
$corps = $reponseHttp->getCorps(); |
return $corps; |
} |
|
private function initialiserRessourcesEtParametres($ressources, $parametres) { |
$this->ressources = $ressources; |
$this->parametres = $parametres; |
100,6 → 117,8 |
$retour = $service->consulter($this->ressources, $this->parametres); |
} elseif ($this->methode == 'ajouter') { |
$retour = $service->ajouter($this->ressources, $this->parametres); |
} elseif ($this->methode == 'modifier') { |
$retour = $service->modifier($this->ressources, $this->parametres); |
} |
} |
} |
120,6 → 139,8 |
//S'il y a 1 ressource et que celle ci est 'deconnecter', envoyer vers deconnecter |
if (sizeof($this->ressources) == 1 && ($this->ressources[0] == 'deconnecter')) { |
$this->serviceNom = 'deconnecter'; |
} else if(sizeof($this->ressources) == 2 && $this->ressources[1] == 'preferences') { |
$this->serviceNom = 'preferences'; |
} else if (sizeof($this->ressources) == 2) { |
$this->serviceNom = 'connecter'; |
} else { |