Subversion Repositories eFlore/Applications.del

Rev

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

Rev 858 Rev 864
Line 66... Line 66...
66
		$reponseHttp->emettreLesEntetes();
66
		$reponseHttp->emettreLesEntetes();
67
		$corps = $reponseHttp->getCorps();
67
		$corps = $reponseHttp->getCorps();
68
		return $corps;
68
		return $corps;
69
	}
69
	}
Line -... Line 70...
-
 
70
	
-
 
71
	public function supprimer($ressources) {
-
 
72
		$this->methode = 'supprimer';
-
 
73
		$resultat = '';
-
 
74
		$reponseHttp = new ReponseHttp();
-
 
75
		try {
-
 
76
			$this->ressources = $ressources;
-
 
77
			$this->conteneur = new Conteneur();
-
 
78
			$resultat = $this->traiterRessources();
-
 
79
			$reponseHttp->setResultatService($resultat);
-
 
80
		} catch (Exception $e) {
-
 
81
			$reponseHttp->ajouterErreur($e);
-
 
82
		}
-
 
83
		$reponseHttp->emettreLesEntetes();
-
 
84
		$corps = $reponseHttp->getCorps();
-
 
85
		return $corps;
-
 
86
	}
70
	
87
	
71
	private function initialiserRessourcesEtParametres($ressources, $parametres) {
88
	private function initialiserRessourcesEtParametres($ressources, $parametres) {
72
		$this->ressources = $ressources;
89
		$this->ressources = $ressources;
73
		$this->parametres = $parametres;
90
		$this->parametres = $parametres;
Line 115... Line 132...
115
				$service = new $classe($this->conteneur);
132
				$service = new $classe($this->conteneur);
116
				if ($this->methode == 'consulter') {
133
				if ($this->methode == 'consulter') {
117
					$retour = $service->consulter($this->ressources, $this->parametres);
134
					$retour = $service->consulter($this->ressources, $this->parametres);
118
				} elseif ($this->methode == 'ajouter') {
135
				} elseif ($this->methode == 'ajouter') {
119
					$retour = $service->ajouter($this->ressources, $this->parametres);				
136
					$retour = $service->ajouter($this->ressources, $this->parametres);				
-
 
137
				} elseif ($this->methode == 'supprimer') {
-
 
138
					$retour = $service->supprimer($this->ressources, $this->parametres);
120
				}
139
				}
121
			}
140
			}
122
		}
141
		}
Line 123... Line 142...
123
		
142
		
Line 132... Line 151...
132
	private function chargerNomService() {
151
	private function chargerNomService() {
133
		// si la méthode est POST, on ajouter un commentaire
152
		// si la méthode est POST, on ajouter un commentaire
134
		if ($this->methode == 'ajouter') {
153
		if ($this->methode == 'ajouter') {
135
			$this->serviceNom = 'ajouter-commentaire';
154
			$this->serviceNom = 'ajouter-commentaire';
136
		} else if ($this->methode == 'supprimer') {
155
		} else if ($this->methode == 'supprimer') {
137
			// ??
-
 
138
			$this->serviceNom = 'supprimer-commentaire';
156
			$this->serviceNom = 'supprimer-commentaire';
139
		}
157
		}
140
		else {
158
		else {
141
			//S'il n'y a pas de ressources => tous les commentaires
159
			//S'il n'y a pas de ressources => tous les commentaires
142
			if (!isset($this->ressources) || empty($this->ressources)) {
160
			if (!isset($this->ressources) || empty($this->ressources)) {