Subversion Repositories eFlore/Applications.coel-consultation

Rev

Rev 15 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
15 jpm 1
<?php
2
// declare(encoding='UTF-8');
3
/**
4
 * Modèle d'accès à la base de données des Collections pour le module Structure.
5
 *
6
 * @package		Collection
7
 * @category	php 5.2
8
 * @author		Jean-Pascal MILCENT <jpm@tela-botanica.org>
9
 * @copyright	2010 Tela-Botanica
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
12
 * @version		SVN: $Id$
13
 *
14
 */
15
class StructureDao extends ColModele {
16
 
17
	/**
18
	 * Retourne l'ensemble des information sur une structure.
19
	 *
20
	 * @param integer l'id de la structure.
21
	 * @return array un tableau contenant les informations sur la structure.
22
	 */
16 jpm 23
	public function getStructure($id) {
15 jpm 24
		$json = file_get_contents("http://www.tela-botanica.org/eflore/coel/jrest/CoelStructure/*/$id/*");
25
		$donnees = json_decode($json, true);
26
		return $donnees[1];
27
	}
16 jpm 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
	}
15 jpm 41
}
42
?>