Subversion Repositories eFlore/Applications.coel-consultation

Rev

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

Rev 16 Rev 19
Line 11... Line 11...
11
 * @license		http://www.gnu.org/licenses/gpl.html Licence GNU-GPL
11
 * @license		http://www.gnu.org/licenses/gpl.html Licence GNU-GPL
12
 * @version		SVN: $Id$
12
 * @version		SVN: $Id$
13
 *
13
 *
14
 */
14
 */
15
class StructureDao extends ColModele {
15
class StructureDao extends ColModele {
-
 
16
	const SERVICE_STRUCTURE = 'CoelStructure';
-
 
17
	const SERVICE_STRUCTURE_A_PERSONNE = 'CoelStructureAPersonne';
16
 
18
	
17
	/**
19
	/**
18
	 * Retourne l'ensemble des information sur une structure.
20
	 * Retourne l'ensemble des information sur une structure.
19
	 * 
21
	 * 
20
	 * @param integer l'id de la structure.
22
	 * @param integer l'id de la structure.
21
	 * @return array un tableau contenant les informations sur la structure.
23
	 * @return array un tableau contenant les informations sur la structure.
22
	 */
24
	 */
23
	public function getStructure($id) {
25
	public function getStructure($id) {
24
		$json = file_get_contents("http://www.tela-botanica.org/eflore/coel/jrest/CoelStructure/*/$id/*");
26
		$url = $this->url_jrest.self::SERVICE_STRUCTURE."/*/$id/*";
-
 
27
		$json = file_get_contents($url);
25
		$donnees = json_decode($json, true);
28
		$donnees = json_decode($json, true);
26
		return $donnees[1];
29
		return $donnees[1];
27
	}
30
	}
Line 28... Line 31...
28
	
31
	
Line 31... Line 34...
31
	 * 
34
	 * 
32
	 * @param integer l'id de la structure.
35
	 * @param integer l'id de la structure.
33
	 * @return array un tableau contenant les informations sur le personnel de la structure.
36
	 * @return array un tableau contenant les informations sur le personnel de la structure.
34
	 */
37
	 */
35
	public function getPersonnel($id) {
38
	public function getPersonnel($id) {
36
		$json = file_get_contents("http://www.tela-botanica.org/eflore/coel/jrest/CoelStructureAPersonne/$id");
39
		$url = $this->url_jrest.self::SERVICE_STRUCTURE_A_PERSONNE."/$id";
-
 
40
		$json = file_get_contents($url);
37
		$donnees = json_decode($json, true);
41
		$donnees = json_decode($json, true);
38
		$this->nettoyerTableauDeTableauxAssoc($donnees);
42
		$this->nettoyerTableauDeTableauxAssoc($donnees);
39
		return $donnees;
43
		return $donnees;
40
	}
44
	}
41
}
45
}