Subversion Repositories eFlore/Projets.eflore-projets

Compare Revisions

Regard whitespace Rev 963 → Rev 964

/trunk/services/modules/0.1/baseflor/Informations.php
19,8 → 19,6
*
*/
 
 
 
class Informations extends Commun {
protected $limite_requete = array( 'depart' => 0, 'limite' => 10);
50,10 → 48,8
// SELECT * FROM baseflor_index_v2012_12_31 WHERE `bdnt.nn` = 'bdtfx.nn:XXXXX';
$resultat = $this->Bdd->recupererTous($requete . ' -- ' . __FILE__ . ':' .__LINE__);
$versionResultat = $this->renvoyerResultat($resultat);
if ($versionResultat == null) {
$message = 'Les données recherchées sont introuvables.';
$code = RestServeur::HTTP_CODE_RESSOURCE_INTROUVABLE;
throw new Exception($message, $code);
if ($versionResultat === null) {
throw new Exception('Les données recherchées sont introuvables.', RestServeur::HTTP_CODE_RESSOURCE_INTROUVABLE);
}
return $versionResultat;
}
64,19 → 60,22
}
public function renvoyerResultat($resultat) {
$res_formate = array();
if (empty($this->ressources)) {
$res_formate = $this->retournerResultatFormate($resultat);
} else {
$classe = empty($resultat[0]['baseflor']) ? 'InformationsTaxonsSup' : 'InformationsBaseflor';
$info = new $classe(new Conteneur());
$res_formate = $info->consulter($this->ressources, $this->parametres);
if (empty($this->ressources)) return $this->retournerResultatFormate($resultat);
if(empty($resultat[0]['baseflor'])) {
if(@$this->parametres['categorie'] == 'description') {
// non-supporté par InformationsTaxonsSup.php...
return array();
}
return $res_formate;
$info = new InformationsTaxonsSup(new Conteneur());
return $info->consulter($this->ressources, $this->parametres);
}
$info = new InformationsBaseflor(new Conteneur());
return $info->consulter($this->ressources, $this->parametres);
}
//+--------------------------traitement ressources ou paramètres -------------------------------------+