| 396 |
mathilde |
1 |
<?php
|
|
|
2 |
/**
|
| 448 |
mathilde |
3 |
* Classe Graphiques.php détermine le type de graphiques à afficher en fonction des données des tables
|
|
|
4 |
* baseflor et baseflor_rang_sup_ecologie
|
| 396 |
mathilde |
5 |
* fin d'url possibles :
|
| 402 |
mathilde |
6 |
* graphiques/#typegraphique/#bdnt.nn:#num_nomen --> renvoie une graphique avec les données connues
|
| 448 |
mathilde |
7 |
*
|
| 396 |
mathilde |
8 |
*
|
|
|
9 |
* @package eflore-projets
|
|
|
10 |
* @author Jean-Pascal MILCENT <jpm@tela-botanica.org>
|
|
|
11 |
* @author Mathilde SALTHUN-LASSALLE <mathilde@tela-botanica.org>
|
|
|
12 |
* @license GPL v3 <http://www.gnu.org/licenses/gpl.txt>
|
|
|
13 |
* @license CECILL v2 <http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt>
|
|
|
14 |
* @version 1.0
|
|
|
15 |
* @copyright 1999-2011 Tela Botanica (accueil@tela-botanica.org)
|
|
|
16 |
*/
|
|
|
17 |
|
| 421 |
mathilde |
18 |
class Graphiques extends Commun{
|
| 402 |
mathilde |
19 |
|
| 396 |
mathilde |
20 |
|
| 410 |
mathilde |
21 |
|
|
|
22 |
|
| 448 |
mathilde |
23 |
private $Graph_tables = array('GraphiquesBaseflor', 'GraphiquesTaxonsSup');
|
| 402 |
mathilde |
24 |
|
| 448 |
mathilde |
25 |
public function consulter($ressources, $parametres) {
|
|
|
26 |
$versionResultat = null;
|
|
|
27 |
foreach ($this->Graph_tables as $graph_tab) {
|
|
|
28 |
$Graph = new $graph_tab();
|
|
|
29 |
$versionResultat = $Graph->consulter($ressources, $parametres);
|
|
|
30 |
if($versionResultat != null) {break;}
|
| 396 |
mathilde |
31 |
}
|
| 448 |
mathilde |
32 |
if ($versionResultat == null) {
|
| 402 |
mathilde |
33 |
$message = 'Les données recherchées sont introuvables.';
|
| 396 |
mathilde |
34 |
$code = RestServeur::HTTP_CODE_RESSOURCE_INTROUVABLE;
|
|
|
35 |
throw new Exception($message, $code);
|
|
|
36 |
}
|
| 448 |
mathilde |
37 |
return $versionResultat;
|
| 396 |
mathilde |
38 |
}
|
|
|
39 |
|
| 402 |
mathilde |
40 |
|
| 396 |
mathilde |
41 |
}
|
|
|
42 |
?>
|