Subversion Repositories Sites.obs-saisons.fr

Compare Revisions

Ignore whitespace Rev 30 → Rev 31

/trunk/applications/saisie/bibliotheque/dao/StationDao.php
New file
0,0 → 1,76
<?php
// declare(encoding='UTF-8');
/**
* Modèle d'accès à la base de données de saisies pour le module stations.
*
* @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 StationDao extends Dao {
const SERVICE_STATION = 'OdsStation';
 
/**
* Retourne l'ensemble des stations d'un participant.
*
* @return array un tableau contenant les informations sur les stations du participant.
*/
public function getListeStations() {
$url = $this->url_jrest.self::SERVICE_STATION.'/'.AppControleur::getIdUtilisateur().'/*/';
$json = $this->envoyerRequeteConsultation($url);
$donnees = json_decode($json, true);
return $donnees;
}
public function getInformationsStation($id_station) {
$url = $this->url_jrest.self::SERVICE_STATION.'/'.AppControleur::getIdUtilisateur().'/'.$id_station.'/';
$json = $this->envoyerRequeteConsultation($url);
$donnees = json_decode($json, true);
return $donnees;
}
public function ajouterStation($valeurs_station_verifiees) {
$donnees = $valeurs_station_verifiees;
$donnees['id_participant'] = AppControleur::getIdUtilisateur();
$url = $this->url_jrest.self::SERVICE_STATION."/";
$json = $this->envoyerRequeteAjout($url, $donnees);
$donnees = json_decode($json, true);
if (true) {
//TODO: verifier ajout
}
return true;
}
public function modifierStation($id_station, $valeurs_station_verifiees) {
$donnees = $valeurs_station_verifiees;
$donnees['id_participant'] = AppControleur::getIdUtilisateur();
if (is_numeric($id_station)) {
$url = $this->url_jrest.self::SERVICE_STATION."/$id_station";
$json = $this->envoyerRequeteModif($url, $donnees);
$donnees = json_decode($json, true);
if (true) {
//TODO: verifier modification
}
}
return true;
}
}
?>