Subversion Repositories eFlore/Applications.coel-consultation

Rev

Rev 15 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 15 Rev 16
1
<?php
1
<?php
2
// declare(encoding='UTF-8');
2
// declare(encoding='UTF-8');
3
/**
3
/**
4
 * Modèle d'accès à la base de données des Collections pour le module Structure.
4
 * Modèle d'accès à la base de données des Collections pour le module Structure.
5
 *
5
 *
6
 * @package		Collection
6
 * @package		Collection
7
 * @category	php 5.2
7
 * @category	php 5.2
8
 * @author		Jean-Pascal MILCENT <jpm@tela-botanica.org>
8
 * @author		Jean-Pascal MILCENT <jpm@tela-botanica.org>
9
 * @copyright	2010 Tela-Botanica
9
 * @copyright	2010 Tela-Botanica
10
 * @license		http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
10
 * @license		http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
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
 
16
 
17
	/**
17
	/**
18
	 * Retourne l'ensemble des information sur une structure.
18
	 * Retourne l'ensemble des information sur une structure.
19
	 * 
19
	 * 
20
	 * @param integer l'id de la structure.
20
	 * @param integer l'id de la structure.
21
	 * @return array un tableau contenant les informations sur la structure.
21
	 * @return array un tableau contenant les informations sur la structure.
22
	 */
22
	 */
23
   public function getStructure($id) {
23
	public function getStructure($id) {
24
		$json = file_get_contents("http://www.tela-botanica.org/eflore/coel/jrest/CoelStructure/*/$id/*");
24
		$json = file_get_contents("http://www.tela-botanica.org/eflore/coel/jrest/CoelStructure/*/$id/*");
25
		$donnees = json_decode($json, true);
25
		$donnees = json_decode($json, true);
26
		//Debug::printr($json);
-
 
27
		return $donnees[1];
26
		return $donnees[1];
28
	}
27
	}
-
 
28
	
-
 
29
	/**
-
 
30
	 * Retourne l'ensemble des informations du personnel d'une structure.
-
 
31
	 * 
-
 
32
	 * @param integer l'id de la structure.
-
 
33
	 * @return array un tableau contenant les informations sur le personnel de la structure.
-
 
34
	 */
-
 
35
	public function getPersonnel($id) {
-
 
36
		$json = file_get_contents("http://www.tela-botanica.org/eflore/coel/jrest/CoelStructureAPersonne/$id");
-
 
37
		$donnees = json_decode($json, true);
-
 
38
		$this->nettoyerTableauDeTableauxAssoc($donnees);
-
 
39
		return $donnees;
-
 
40
	}
29
}
41
}
30
?>
42
?>