Subversion Repositories eFlore/Applications.del

Rev

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

Rev 1806 Rev 1808
Line 10... Line 10...
10
 * @author		Jean-Pascal MILCENT <jpm@tela-botanica.org>
10
 * @author		Jean-Pascal MILCENT <jpm@tela-botanica.org>
11
 * @license		GPL v3 <http://www.gnu.org/licenses/gpl.txt>
11
 * @license		GPL v3 <http://www.gnu.org/licenses/gpl.txt>
12
 * @license		CECILL v2 <http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt>
12
 * @license		CECILL v2 <http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt>
13
 * @copyright	©1999-2014, Tela Botanica (<accueil@tela-botanica.org>)
13
 * @copyright	©1999-2014, Tela Botanica (<accueil@tela-botanica.org>)
14
 */
14
 */
15
 
-
 
16
class ListeCommunes {
15
class ListeCommunes {
Line 17... Line 16...
17
 
16
 
18
	private $conteneur;
17
	private $conteneur;
19
	private $navigation;
-
 
20
	private $parametres = array();
-
 
Line 21... Line 18...
21
	private $ressources = array();
18
	private $navigation;
22
 
19
 
23
	public function __construct(Conteneur $conteneur = null) {
20
	public function __construct(Conteneur $conteneur = null) {
24
		$this->conteneur = $conteneur == null ? new Conteneur() : $conteneur;
21
		$this->conteneur = $conteneur == null ? new Conteneur() : $conteneur;
Line 25... Line 22...
25
		$this->navigation = $conteneur->getNavigation();
22
		$this->navigation = $conteneur->getNavigation();
26
	}
-
 
27
 
-
 
28
	public function consulter($parametres) {
23
	}
29
		$this->parametres = $parametres;
24
 
30
 
25
	public function consulter() {
31
		$communes = $this->chargerCommunes();
26
		$communes = $this->chargerCommunes();
Line 41... Line 36...
41
	private function chargerCommunes() {
36
	private function chargerCommunes() {
42
		$urlCelTpl = $this->conteneur->getParametre('urlServiceCelCommune');
37
		$urlCelTpl = $this->conteneur->getParametre('urlServiceCelCommune');
43
		$url = $urlCelTpl.$this->navigation->getFiltre('masque.nom');
38
		$url = $urlCelTpl.$this->navigation->getFiltre('masque.nom');
44
		$restClient = $this->conteneur->getRestClient();
39
		$restClient = $this->conteneur->getRestClient();
45
		$resultatJson = $restClient->consulter($url);
40
		$resultatJson = $restClient->consulter($url);
46
		var_dump($url);
-
 
47
		$resultat = json_decode($resultatJson);
41
		$resultat = json_decode($resultatJson);
48
 
-
 
49
		return $resultat;
42
		return $resultat;
50
	}
43
	}
Line 51... Line 44...
51
 
44
 
52
	private function compterCommunes($communes) {
45
	private function compterCommunes($communes) {
53
		return count($communes);
46
		return count($communes);
54
	}
47
	}
55
}
48
}