Rev 37 | Rev 58 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
<?php// declare(encoding='UTF-8');/*** Modèle d'accès à la base de données des Référentiels.* Permet d'accèder au données des référentiels.** @package Referentiel* @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 ReferentielDao extends Dao {const SERVICE = 'Referentiel';/*** Retourne des infos sur l'ensemble des référentiels disponibles.** @return array un tableau contenant les informations sur les référentiels disponibles.*/public function getReferentielsDispo() {$url = $this->url_jrest.self::SERVICE."/Dispo";$json = $this->envoyerRequeteConsultation($url);$noms = json_decode($json, true);return $noms;}/*** Retourne l'ensemble des information sur les noms d'un référentiel.** @param string le code du référentiel.* @return array un tableau contenant les informations sur les noms du référentiel.*/public function getTout($code_projet) {$url = $this->url_jrest.self::SERVICE."/Tout/$code_projet";$nbre = $this->getNombre($code_projet);$noms = array();$pas = 1000;for ($i = 0; $i < $nbre ; $i += $pas) {$this->setLimitation($i, $pas);$json = $this->envoyerRequeteConsultation($url);$noms_partiel = json_decode($json, true);$noms = array_merge($noms, $noms_partiel);}return $noms;}/*** Retourne le nombre de noms présents dans la table de travail du référentiel.** @param string le code du référentiel.* @return int le nombre de noms.*/public function getNombre($code_projet) {$url = $this->url_jrest.self::SERVICE."/Nombre/$code_projet";$json = $this->envoyerRequeteConsultation($url);$nbre = json_decode($json, true);return $nbre;}}?>