Subversion Repositories eFlore/Applications.del

Rev

Rev 864 | Rev 972 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 864 Rev 883
Line 53... Line 53...
53
	
53
	
54
	public function ajouter($ressources, $parametres) {
54
	public function ajouter($ressources, $parametres) {
55
		$this->methode = 'ajouter';
55
		$this->methode = 'ajouter';
56
		$resultat = '';
56
		$resultat = '';
-
 
57
		$reponseHttp = new ReponseHttp();
57
		$reponseHttp = new ReponseHttp();
58
		
58
		try {
59
		try {
59
			$this->initialiserRessourcesEtParametres($ressources, $parametres);
60
			$this->initialiserRessourcesEtParametres($ressources, $parametres);
60
			$this->conteneur = new Conteneur($this->parametres);
61
			$this->conteneur = new Conteneur($this->parametres);
61
			$resultat = $this->traiterRessources();
62
			$resultat = $this->traiterRessources();
62
			$reponseHttp->setResultatService($resultat);
63
			$reponseHttp->setResultatService($resultat);
63
		} catch (Exception $e) {
64
		} catch (Exception $e) {
64
			$reponseHttp->ajouterErreur($e);
65
			$reponseHttp->ajouterErreur($e);
65
		}
-
 
66
		$reponseHttp->emettreLesEntetes();
66
		}
67
		$corps = $reponseHttp->getCorps();
67
		$corps = $reponseHttp->getCorps();
68
		return $corps;
68
		return $corps;
Line 69... Line 69...
69
	}
69
	}
Line 131... Line 131...
131
				require_once $chemin;
131
				require_once $chemin;
132
				$service = new $classe($this->conteneur);
132
				$service = new $classe($this->conteneur);
133
				if ($this->methode == 'consulter') {
133
				if ($this->methode == 'consulter') {
134
					$retour = $service->consulter($this->ressources, $this->parametres);
134
					$retour = $service->consulter($this->ressources, $this->parametres);
135
				} elseif ($this->methode == 'ajouter') {
135
				} elseif ($this->methode == 'ajouter') {
136
					$retour = $service->ajouter($this->ressources, $this->parametres);				
136
					$retour = $service->ajouter($this->ressources, $this->parametres);			
137
				} elseif ($this->methode == 'supprimer') {
137
				} elseif ($this->methode == 'supprimer') {
138
					$retour = $service->supprimer($this->ressources, $this->parametres);
138
					$retour = $service->supprimer($this->ressources, $this->parametres);
139
				}
139
				}
140
			}
140
			}
141
		}
141
		}
Line 173... Line 173...
173
 
173
 
174
	private function obtenirNomClasseService($mot) {
174
	private function obtenirNomClasseService($mot) {
175
		$classeNom = str_replace(' ', '', ucwords(strtolower(str_replace('-', ' ', $mot))));
175
		$classeNom = str_replace(' ', '', ucwords(strtolower(str_replace('-', ' ', $mot))));
176
		return $classeNom;
176
		return $classeNom;
177
	}
-
 
178
 
-
 
179
 
177
	}
180
}
178
}
181
?>
179
?>