Subversion Repositories eFlore/Projets.eflore-projets

Rev

Rev 447 | Rev 525 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

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