New file |
0,0 → 1,46 |
<?php |
// declare(encoding='UTF-8'); |
/** |
* Modèle d'accès à la base de données des Collections pour le module Structure. |
* |
* @package Collection |
* @category php 5.2 |
* @author Jean-Pascal MILCENT <jpm@tela-botanica.org> |
* @copyright 2010 Tela-Botanica |
* @license http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL |
* @license http://www.gnu.org/licenses/gpl.html Licence GNU-GPL |
* @version SVN: $Id$ |
* |
*/ |
class StructureDao extends ColModele { |
const SERVICE_STRUCTURE = 'CoelStructure'; |
const SERVICE_STRUCTURE_A_PERSONNE = 'CoelStructureAPersonne'; |
|
/** |
* Retourne l'ensemble des information sur une structure. |
* |
* @param integer l'id de la structure. |
* @return array un tableau contenant les informations sur la structure. |
*/ |
public function getStructure($id) { |
$url = $this->url_jrest.self::SERVICE_STRUCTURE."/*/$id/*"; |
$json = file_get_contents($url); |
$donnees = json_decode($json, true); |
return $donnees[1]; |
} |
|
/** |
* Retourne l'ensemble des informations du personnel d'une structure. |
* |
* @param integer l'id de la structure. |
* @return array un tableau contenant les informations sur le personnel de la structure. |
*/ |
public function getPersonnel($id) { |
$url = $this->url_jrest.self::SERVICE_STRUCTURE_A_PERSONNE."/$id"; |
$json = file_get_contents($url); |
$donnees = json_decode($json, true); |
$this->nettoyerTableauDeTableauxAssoc($donnees); |
return $donnees; |
} |
} |
?> |