13,7 → 13,10 |
* |
*/ |
class CollectionDao extends ColModele { |
|
const SERVICE_COLLECTION = 'CoelCollection'; |
const SERVICE_COLLECTION_A_PERSONNE = 'CoelCollectionAPersonne'; |
const SERVICE_COLLECTION_A_PUBLICATION = 'CoelCollectionAPublication'; |
const SERVICE_COLLECTION_A_COMMENTAIRE = 'CoelCollectionACommentaire'; |
/** |
* Retourne l'ensemble des information sur une collection. |
* |
33,7 → 36,8 |
* @return array un tableau contenant les collections correspondant à l'id structure. |
*/ |
public function getParIdStructure($id_structure) { |
$json = file_get_contents("http://www.tela-botanica.org/eflore/coel/jrest/CoelCollection/ParIdStructure/$id_structure"); |
$url = $this->url_jrest.self::SERVICE_COLLECTION."/ParIdStructure/$id_structure"; |
$json = file_get_contents($url); |
$donnees = json_decode($json, true); |
$this->nettoyerTableauDeTableauxAssoc($donnees); |
return $donnees; |
46,7 → 50,8 |
* @return array un tableau contenant les informations sur les personnes liées à la collection. |
*/ |
public function getCollectionAPersonne($id_collection) { |
$json = file_get_contents("http://www.tela-botanica.org/eflore/coel/jrest/CoelCollectionAPersonne/$id_collection"); |
$url = $this->url_jrest.self::SERVICE_COLLECTION_A_PERSONNE."/$id_collection"; |
$json = file_get_contents($url); |
$donnees = json_decode($json, true); |
$this->nettoyerTableauDeTableauxAssoc($donnees); |
return $donnees; |
59,10 → 64,26 |
* @return array un tableau contenant les informations sur les publications liées à la collection. |
*/ |
public function getCollectionAPublication($id_collection) { |
$json = file_get_contents("http://www.tela-botanica.org/eflore/coel/jrest/CoelCollectionAPublication/$id_collection"); |
$url = $this->url_jrest.self::SERVICE_COLLECTION_A_PUBLICATION."/$id_collection"; |
$json = file_get_contents($url); |
$donnees = json_decode($json, true); |
$this->nettoyerTableauDeTableauxAssoc($donnees); |
return $donnees; |
} |
|
/** |
* Retourne l'ensemble des commentaires publics liés à une collection. |
* |
* @param integer l'id de la collection. |
* @return array un tableau contenant les informations sur les publications liées à la collection. |
*/ |
public function getCollectionACommentaire($id_collection) { |
$commentaire_public = '1'; |
$url = $this->url_jrest.self::SERVICE_COLLECTION_A_COMMENTAIRE."/$id_collection/$commentaire_public"; |
$json = file_get_contents($url); |
$donnees = json_decode($json, true); |
$this->nettoyerTableauDeTableauxAssoc($donnees); |
return $donnees; |
} |
} |
?> |