New file |
0,0 → 1,75 |
<?php |
// declare(encoding='UTF-8'); |
/** |
* Modèle d'accès à la base de données de saisies pour le module observation. |
* |
* @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 ObservationDao extends Dao { |
|
const SERVICE_OBSERVATION = 'OdsObservation'; |
const METHODE_OBSERVATION_INDIVIDU= 'ObservationsPourIndividu'; |
|
/** |
* Retourne l'ensemble des observations d'une station. |
* |
* @param integer l'id d'une station. |
* @return array un tableau contenant les informations sur les observations de cette station. |
*/ |
public function getListeObservationsPourStation($id_station) { |
|
$url = $this->url_jrest.self::SERVICE_OBSERVATION."/*/"; |
$json = $this->envoyerRequeteConsultation($url); |
$donnees = json_decode($json, true); |
return $donnees; |
} |
|
public function getListeObservationsPourIndividu($id_individu, $annee = null) { |
|
if (is_numeric($id_individu)) { |
$url = $this->url_jrest.self::SERVICE_OBSERVATION.'/'.self::METHODE_OBSERVATION_INDIVIDU.'/'.$id_individu; |
$json = $this->envoyerRequeteConsultation($url); |
$donnees = json_decode($json, true); |
return $donnees; |
} |
} |
|
public function ajouterObservation($valeurs_observation_verifiees) { |
|
$donnees = $valeurs_individu_verifiees; |
|
$url = $this->url_jrest.self::SERVICE_OBSERVATION."/"; |
$json = $this->envoyerRequeteAjout($url, $donnees); |
$donnees = json_decode($json, true); |
|
if (true) { |
//TODO: verifier ajout |
} |
|
return true; |
} |
|
public function modifierObservation($id_observation, $valeurs_observation_verifiees) { |
|
$donnees = observation; |
|
if (is_numeric($id_individu)) { |
$url = $this->url_jrest.self::SERVICE_OBSERVATION."/$id_observation"; |
$json = $this->envoyerRequeteModif($url, $donnees); |
$donnees = json_decode($json, true); |
if (true) { |
//TODO: verifier modification |
} |
} |
|
return true; |
} |
} |
?> |