| 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 CollectionDao extends ColModele {
|
15 |
class CollectionDao extends ColModele {
|
| 16 |
|
- |
|
| - |
|
16 |
const SERVICE_COLLECTION = 'CoelCollection';
|
| - |
|
17 |
const SERVICE_COLLECTION_A_PERSONNE = 'CoelCollectionAPersonne';
|
| - |
|
18 |
const SERVICE_COLLECTION_A_PUBLICATION = 'CoelCollectionAPublication';
|
| - |
|
19 |
const SERVICE_COLLECTION_A_COMMENTAIRE = 'CoelCollectionACommentaire';
|
| 17 |
/**
|
20 |
/**
|
| 18 |
* Retourne l'ensemble des information sur une collection.
|
21 |
* Retourne l'ensemble des information sur une collection.
|
| 19 |
*
|
22 |
*
|
| 20 |
* @param integer l'id de la collection.
|
23 |
* @param integer l'id de la collection.
|
| 21 |
* @return array un tableau contenant les informations sur la collection.
|
24 |
* @return array un tableau contenant les informations sur la collection.
|
| Line 31... |
Line 34... |
| 31 |
*
|
34 |
*
|
| 32 |
* @param integer l'id d'une structure.
|
35 |
* @param integer l'id d'une structure.
|
| 33 |
* @return array un tableau contenant les collections correspondant à l'id structure.
|
36 |
* @return array un tableau contenant les collections correspondant à l'id structure.
|
| 34 |
*/
|
37 |
*/
|
| 35 |
public function getParIdStructure($id_structure) {
|
38 |
public function getParIdStructure($id_structure) {
|
| 36 |
$json = file_get_contents("http://www.tela-botanica.org/eflore/coel/jrest/CoelCollection/ParIdStructure/$id_structure");
|
39 |
$url = $this->url_jrest.self::SERVICE_COLLECTION."/ParIdStructure/$id_structure";
|
| - |
|
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 |
}
|
| Line 44... |
Line 48... |
| 44 |
*
|
48 |
*
|
| 45 |
* @param integer l'id de la collection.
|
49 |
* @param integer l'id de la collection.
|
| 46 |
* @return array un tableau contenant les informations sur les personnes liées à la collection.
|
50 |
* @return array un tableau contenant les informations sur les personnes liées à la collection.
|
| 47 |
*/
|
51 |
*/
|
| 48 |
public function getCollectionAPersonne($id_collection) {
|
52 |
public function getCollectionAPersonne($id_collection) {
|
| 49 |
$json = file_get_contents("http://www.tela-botanica.org/eflore/coel/jrest/CoelCollectionAPersonne/$id_collection");
|
53 |
$url = $this->url_jrest.self::SERVICE_COLLECTION_A_PERSONNE."/$id_collection";
|
| - |
|
54 |
$json = file_get_contents($url);
|
| 50 |
$donnees = json_decode($json, true);
|
55 |
$donnees = json_decode($json, true);
|
| 51 |
$this->nettoyerTableauDeTableauxAssoc($donnees);
|
56 |
$this->nettoyerTableauDeTableauxAssoc($donnees);
|
| 52 |
return $donnees;
|
57 |
return $donnees;
|
| 53 |
}
|
58 |
}
|
| Line 57... |
Line 62... |
| 57 |
*
|
62 |
*
|
| 58 |
* @param integer l'id de la collection.
|
63 |
* @param integer l'id de la collection.
|
| 59 |
* @return array un tableau contenant les informations sur les publications liées à la collection.
|
64 |
* @return array un tableau contenant les informations sur les publications liées à la collection.
|
| 60 |
*/
|
65 |
*/
|
| 61 |
public function getCollectionAPublication($id_collection) {
|
66 |
public function getCollectionAPublication($id_collection) {
|
| - |
|
67 |
$url = $this->url_jrest.self::SERVICE_COLLECTION_A_PUBLICATION."/$id_collection";
|
| - |
|
68 |
$json = file_get_contents($url);
|
| - |
|
69 |
$donnees = json_decode($json, true);
|
| - |
|
70 |
$this->nettoyerTableauDeTableauxAssoc($donnees);
|
| - |
|
71 |
return $donnees;
|
| - |
|
72 |
}
|
| - |
|
73 |
|
| - |
|
74 |
/**
|
| - |
|
75 |
* Retourne l'ensemble des commentaires publics liés à une collection.
|
| - |
|
76 |
*
|
| - |
|
77 |
* @param integer l'id de la collection.
|
| 62 |
$json = file_get_contents("http://www.tela-botanica.org/eflore/coel/jrest/CoelCollectionAPublication/$id_collection");
|
78 |
* @return array un tableau contenant les informations sur les publications liées à la collection.
|
| - |
|
79 |
*/
|
| - |
|
80 |
public function getCollectionACommentaire($id_collection) {
|
| - |
|
81 |
$commentaire_public = '1';
|
| - |
|
82 |
$url = $this->url_jrest.self::SERVICE_COLLECTION_A_COMMENTAIRE."/$id_collection/$commentaire_public";
|
| - |
|
83 |
$json = file_get_contents($url);
|
| 63 |
$donnees = json_decode($json, true);
|
84 |
$donnees = json_decode($json, true);
|
| 64 |
$this->nettoyerTableauDeTableauxAssoc($donnees);
|
85 |
$this->nettoyerTableauDeTableauxAssoc($donnees);
|
| 65 |
return $donnees;
|
86 |
return $donnees;
|
| 66 |
}
|
87 |
}
|
| 67 |
}
|
88 |
}
|