Subversion Repositories eFlore/Applications.coel-consultation

Rev

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

Rev Author Line No. Line
17 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 Collections.
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 CollectionDao extends ColModele {
16
 
17
	/**
18
	 * Retourne l'ensemble des information sur une collection.
19
	 *
20
	 * @param integer l'id de la collection.
21
	 * @return array un tableau contenant les informations sur la collection.
22
	 */
23
	public function getCollection($id) {
24
		$json = file_get_contents("http://www.tela-botanica.org/eflore/coel/jrest/CoelCollection/*/$id/*");
25
		$donnees = json_decode($json, true);
26
		return $donnees[1];
27
	}
28
 
29
	/**
18 jpm 30
	 * Retourne les collection correspondant à un id strucutre précis.
31
	 *
32
	 * @param integer l'id d'une structure.
33
	 * @return array un tableau contenant les collections correspondant à l'id structure.
34
	 */
35
	public function getParIdStructure($id_structure) {
36
		$json = file_get_contents("http://www.tela-botanica.org/eflore/coel/jrest/CoelCollection/ParIdStructure/$id_structure");
37
		$donnees = json_decode($json, true);
38
		$this->nettoyerTableauDeTableauxAssoc($donnees);
39
		return $donnees;
40
	}
41
 
42
	/**
17 jpm 43
	 * Retourne l'ensemble des personnes liées à une collection.
44
	 *
45
	 * @param integer l'id de la collection.
46
	 * @return array un tableau contenant les informations sur les personnes liées à la collection.
47
	 */
48
	public function getCollectionAPersonne($id_collection) {
49
		$json = file_get_contents("http://www.tela-botanica.org/eflore/coel/jrest/CoelCollectionAPersonne/$id_collection");
50
		$donnees = json_decode($json, true);
51
		$this->nettoyerTableauDeTableauxAssoc($donnees);
52
		return $donnees;
53
	}
54
 
55
	/**
56
	 * Retourne l'ensemble des publications liées à une collection.
57
	 *
58
	 * @param integer l'id de la collection.
59
	 * @return array un tableau contenant les informations sur les publications liées à la collection.
60
	 */
61
	public function getCollectionAPublication($id_collection) {
62
		$json = file_get_contents("http://www.tela-botanica.org/eflore/coel/jrest/CoelCollectionAPublication/$id_collection");
63
		$donnees = json_decode($json, true);
64
		$this->nettoyerTableauDeTableauxAssoc($donnees);
65
		return $donnees;
66
	}
67
}
68
?>