Line 7... |
Line 7... |
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: CollectionDao.php 34 2010-04-23 13:58:21Z jpm $
|
12 |
* @version SVN: $Id: CollectionDao.php 65 2010-05-06 16:49:32Z jpm $
|
13 |
*
|
13 |
*
|
14 |
*/
|
14 |
*/
|
15 |
class CollectionDao extends ColModele {
|
15 |
class CollectionDao extends ColModele {
|
16 |
const SERVICE_COLLECTION = 'CoelCollection';
|
16 |
const SERVICE_COLLECTION = 'CoelCollection';
|
17 |
const SERVICE_COLLECTION_A_PERSONNE = 'CoelCollectionAPersonne';
|
17 |
const SERVICE_COLLECTION_A_PERSONNE = 'CoelCollectionAPersonne';
|
Line 52... |
Line 52... |
52 |
*/
|
52 |
*/
|
53 |
public function getCollectionAPersonne($id_collection) {
|
53 |
public function getCollectionAPersonne($id_collection) {
|
54 |
$url = $this->url_jrest.self::SERVICE_COLLECTION_A_PERSONNE."/$id_collection";
|
54 |
$url = $this->url_jrest.self::SERVICE_COLLECTION_A_PERSONNE."/$id_collection";
|
55 |
$json = file_get_contents($url);
|
55 |
$json = file_get_contents($url);
|
56 |
$donnees = json_decode($json, true);
|
56 |
$donnees = json_decode($json, true);
|
57 |
$this->nettoyerTableauDeTableauxAssoc($donnees);
|
57 |
$this->nettoyerTableauDeTableauxAssoc($donnees['collectionsAPersonne']);
|
58 |
return $donnees;
|
58 |
return $donnees['collectionsAPersonne'];
|
59 |
}
|
59 |
}
|
Line 60... |
Line 60... |
60 |
|
60 |
|
61 |
/**
|
61 |
/**
|
62 |
* Retourne l'ensemble des publications liées à une collection.
|
62 |
* Retourne l'ensemble des publications liées à une collection.
|
Line 66... |
Line 66... |
66 |
*/
|
66 |
*/
|
67 |
public function getCollectionAPublication($id_collection) {
|
67 |
public function getCollectionAPublication($id_collection) {
|
68 |
$url = $this->url_jrest.self::SERVICE_COLLECTION_A_PUBLICATION."/$id_collection";
|
68 |
$url = $this->url_jrest.self::SERVICE_COLLECTION_A_PUBLICATION."/$id_collection";
|
69 |
$json = file_get_contents($url);
|
69 |
$json = file_get_contents($url);
|
70 |
$donnees = json_decode($json, true);
|
70 |
$donnees = json_decode($json, true);
|
71 |
$this->nettoyerTableauDeTableauxAssoc($donnees);
|
71 |
$this->nettoyerTableauDeTableauxAssoc($donnees['collectionsAPublication']);
|
72 |
return $donnees;
|
72 |
return $donnees['collectionsAPublication'];
|
73 |
}
|
73 |
}
|
Line 74... |
Line 74... |
74 |
|
74 |
|
75 |
/**
|
75 |
/**
|
76 |
* Retourne l'ensemble des commentaires publics liés à une collection.
|
76 |
* Retourne l'ensemble des commentaires publics liés à une collection.
|
Line 81... |
Line 81... |
81 |
public function getCollectionACommentaire($id_collection) {
|
81 |
public function getCollectionACommentaire($id_collection) {
|
82 |
$commentaire_public = '1';
|
82 |
$commentaire_public = '1';
|
83 |
$url = $this->url_jrest.self::SERVICE_COLLECTION_A_COMMENTAIRE."/$id_collection/$commentaire_public";
|
83 |
$url = $this->url_jrest.self::SERVICE_COLLECTION_A_COMMENTAIRE."/$id_collection/$commentaire_public";
|
84 |
$json = file_get_contents($url);
|
84 |
$json = file_get_contents($url);
|
85 |
$donnees = json_decode($json, true);
|
85 |
$donnees = json_decode($json, true);
|
86 |
$this->nettoyerTableauDeTableauxAssoc($donnees);
|
86 |
$this->nettoyerTableauDeTableauxAssoc($donnees['collectionsACommentaire']);
|
87 |
return $donnees;
|
87 |
return $donnees['collectionsACommentaire'];
|
88 |
}
|
88 |
}
|
89 |
}
|
89 |
}
|
90 |
?>
|
90 |
?>
|
91 |
|
91 |
|