Subversion Repositories eFlore/Applications.coel-consultation

Rev

Rev 17 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

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