Rev 34 | 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 de saisies pour le module espece.** @package ODS_saisie* @category php 5.2* @author Aurélien Peronnet <aurelien@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: StationDao.php 154 2010-09-13 12:15:11Z aurelien $**/class EspeceDao extends Dao {const SERVICE_ESPECE = 'OdsEspece';const METHODE_ESPECES_STATION = 'EspecesPourStation';const METHODE_ESPECES_TYPE = 'EspecesParType';const METHODE_INFOS_ESPECE = 'Espece';/*** Retourne l'ensemble des especes.** @return array un tableau contenant les informations sur les especes.*/public function getListeEspeces() {$url = $this->url_jrest.self::SERVICE_ESPECE."/*/";$json = $this->envoyerRequeteConsultation($url);$donnees = json_decode($json, true);return $donnees;}/*** Retourne l'ensemble des especes présentes dans une station.** @param integer l'id de de la station.* @return array un tableau contenant les informations sur les especes de cette station.*/public function getListeEspecesPourStation($id_station) {$url = $this->url_jrest.self::SERVICE_ESPECE.'/'.self::METHODE_ESPECES_STATION.'/'.$id_station;$json = $this->envoyerRequeteConsultation($url);$donnees = json_decode($json, true);return $donnees;}/*** Retourne l'ensemble des especes présentes organisées hierarchiquement par type.** @return array un tableau contenant les informations sur les especes.*/public function getListeEspecesParType() {$url = $this->url_jrest.self::SERVICE_ESPECE.'/'.self::METHODE_ESPECES_TYPE.'/';$json = $this->envoyerRequeteConsultation($url);$donnees = json_decode($json, true);return $donnees;}public function getInformationsEspece($id_espece) {$url = $this->url_jrest.self::SERVICE_ESPECE.'/'.self::METHODE_INFOS_ESPECE.'/'.$id_espece;$json = $this->envoyerRequeteConsultation($url);$donnees = json_decode($json, true);return $donnees;}public function ajouterEspeceDansStation($valeurs_espece_station_verifiees) {$donnees = $valeurs_espece_station_verifiees;$donnees['id_participant'] = AppControleur::getIdUtilisateur();$url = $this->url_jrest.self::SERVICE_ESPECE."/";$json = $this->envoyerRequeteAjout($url, $donnees);$donnees = json_decode($json, true);if (true) {//TODO: verifier ajout}return true;}}?>