Subversion Repositories eFlore/Projets.eflore-projets

Rev

Rev 414 | Rev 517 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
379 mathilde 1
<?php
2
 
3
/**
447 mathilde 4
* Classe Informations.php redirige vers le web service pour baseflor ou pour les rangs supérieurs
5
*
379 mathilde 6
* Encodage en entrée : utf8
7
* Encodage en sortie : utf8
8
* @package eflore-projets
9
* @author Mathilde SALTHUN-LASSALLE <mathilde@tela-botanica.org>
10
* @author Jean-Pascal MILCENT <jpm@tela-botanica.org>
11
* @license GPL v3 <http://www.gnu.org/licenses/gpl.txt>
12
* @license CECILL v2 <http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt>
13
* @version 1.0
14
* @copyright 1999-2011 Tela Botanica (accueil@tela-botanica.org)
15
*/
16
 
17
class Informations extends Commun{
18
 
447 mathilde 19
	private $info_tables = array('InformationsBaseflor', 'InformationsTaxonsSup');
395 mathilde 20
 
447 mathilde 21
	public function consulter($ressources, $parametres) {
403 mathilde 22
 
447 mathilde 23
		$versionResultat = null;
24
		foreach ($this->info_tables as $info_tab) {
25
			$info = new $info_tab();
26
			$versionResultat = $info->consulter($ressources, $parametres);
27
			if($versionResultat != null) {
28
				break;
379 mathilde 29
			}
30
		}
395 mathilde 31
 
447 mathilde 32
		if ($versionResultat == null) {
33
			$message = 'Les données recherchées sont introuvables.';
34
			$code = RestServeur::HTTP_CODE_RESSOURCE_INTROUVABLE;
35
			throw new Exception($message, $code);
379 mathilde 36
		}
447 mathilde 37
		return $versionResultat;
379 mathilde 38
	}
39
 
40
 
41
}