Subversion Repositories eFlore/Projets.eflore-projets

Rev

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

Rev 391 Rev 395
1
<?php
1
<?php
2
 
2
 
3
/**
3
/**
4
* Classe Informations.php permet de faire des requetes de baseflor en fonction d'un référentiel
4
* Classe Informations.php permet de faire des requetes de baseflor en fonction d'un référentiel
5
*( BDTFX, BDAFX, BDBFX ) et d'un numéro nomenclatural ( différent de 0 ). 
5
*( BDTFX, BDAFX, BDBFX ) et d'un numéro nomenclatural ( différent de 0 ). 
6
*  fin d'url possibles :
6
*  fin d'url possibles :
7
*  /informations/#bdnt.nn:#num_nomen --> retourne tous les champs pour un BDNT et un num_nomen
7
*  /informations/#bdnt.nn:#num_nomen --> retourne tous les champs pour un BDNT et un num_nomen
8
*  /informations/#bdnt.nn:#num_nomen?test=description --> retourne champs description pour un BDNT et un num_nomen
8
*  /informations/#bdnt.nn:#num_nomen?test=description --> retourne champs description pour un BDNT et un num_nomen
9
*  /informations/#bdnt.nn:#num_nomen?test=ecologie --> retourne champs ecologiques pour un BDNT et un num_nomen
9
*  /informations/#bdnt.nn:#num_nomen?test=ecologie --> retourne champs ecologiques pour un BDNT et un num_nomen
10
*  /informations --> retourne les 10 premiers résultats
10
*  /informations --> retourne les 10 premiers résultats
11
*  /informations?navigation.limite=..&navigation.depart=.. --> retourne les 10 premiers résultats avec limites
11
*  /informations?navigation.limite=..&navigation.depart=.. --> retourne les 10 premiers résultats avec limites
12
*
12
*
13
* Encodage en entrée : utf8
13
* Encodage en entrée : utf8
14
* Encodage en sortie : utf8
14
* Encodage en sortie : utf8
15
* @package eflore-projets
15
* @package eflore-projets
16
* @author Mathilde SALTHUN-LASSALLE <mathilde@tela-botanica.org>
16
* @author Mathilde SALTHUN-LASSALLE <mathilde@tela-botanica.org>
17
* @author Delphine CAUQUIL <delphine@tela-botanica.org>
17
* @author Delphine CAUQUIL <delphine@tela-botanica.org>
18
* @author Jean-Pascal MILCENT <jpm@tela-botanica.org>
18
* @author Jean-Pascal MILCENT <jpm@tela-botanica.org>
19
* @license GPL v3 <http://www.gnu.org/licenses/gpl.txt>
19
* @license GPL v3 <http://www.gnu.org/licenses/gpl.txt>
20
* @license CECILL v2 <http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt>
20
* @license CECILL v2 <http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt>
21
* @version 1.0
21
* @version 1.0
22
* @copyright 1999-2011 Tela Botanica (accueil@tela-botanica.org)
22
* @copyright 1999-2011 Tela Botanica (accueil@tela-botanica.org)
23
*/
23
*/
24
 
24
 
25
class Informations extends Commun{
25
class Informations extends Commun{
26
	
26
	
27
	protected $table="";
27
	protected $table="";
28
	private $requete_condition = "";
28
	private $requete_condition = "";
29
	/** Permet de stocker la requete formulée:  /informations/bdnt.nn |  */
29
	/** Permet de stocker la requete formulée:  /informations/bdnt.nn |  */
30
	private $format_reponse = 'informations';
30
	private $format_reponse = 'informations';
31
	private $total_resultat;
31
	private $total_resultat;
-
 
32
	private $retour_format = 'max';
32
	protected $limite_requete = array( 'depart' => 0, 'limite' => 10);
33
	protected $limite_requete = array( 'depart' => 0, 'limite' => 10);
33
	private $champs_recherches='*';
34
	private $champs_recherches = '*';
34
	
-
 
-
 
35
	private $champs_ontologiques =  array ('ve_lumiere' => 'VEL', 've_temperature' => 'VET', 
-
 
36
											've_continentalite' => 'VEC', 've_humidite_atmos' => 'VEHA',
-
 
37
											've_humidite_edaph' => 'VEHE', 've_reaction_sol' => 'VER' ,
-
 
38
											've_nutriments_sol' => 'VEN', 've_salinite'=> 'VES' , 
-
 
39
											've_texture_sol' => 'VETX', 've_mat_org_sol' => 'VEMO');
35
	
40
 
-
 
41
//+--------------------------traitement ressources ou paramètres  -------------------------------------------+	
36
	public function traiterParametres() {
42
	public function traiterParametres() {
37
		if (isset($this->parametres) && !empty($this->parametres)) {
43
		if (isset($this->parametres) && !empty($this->parametres)) {
38
			foreach ($this->parametres as $param => $valeur) {
44
			foreach ($this->parametres as $param => $valeur) {
39
				switch ($param) {
45
				switch ($param) {
40
					case 'navigation.depart'  : 
46
					case 'navigation.depart'  : 
41
						 $this->limite_requete['depart'] = $valeur;	 break;
47
						 $this->limite_requete['depart'] = $valeur;	 break;
42
					case 'navigation.limite'  :  $this->limite_requete['limite'] = $valeur;	  break;
48
					case 'navigation.limite'  :  $this->limite_requete['limite'] = $valeur;	  break;
43
					case 'test'  : 
49
					case 'test'  : 
44
						if ($valeur == "description") {
50
						if ($valeur == "description") {
45
							$this->champs_recherches="cle, chorologie, inflorescence, sexualite, ordre_maturation, "
51
							$this->champs_recherches="cle, chorologie, inflorescence, sexualite, ordre_maturation, "
46
							."pollinisation, fruit, dissemination, couleur_fleur, macule, floraison, type_bio, "
52
							."pollinisation, fruit, dissemination, couleur_fleur, macule, floraison, type_bio, "
47
						 	."form_vegetale ";	
53
						 	."form_vegetale ";	
48
						}elseif ($valeur == "ecologie"){
54
						}elseif ($valeur == "ecologie"){
49
							$this->champs_recherches="cle, ve_lumiere , ve_temperature, ve_continentalite, 
55
							$this->champs_recherches="cle, ve_lumiere , ve_temperature, ve_continentalite, 
50
							ve_humidite_atmos, ve_humidite_edaph, ve_reaction_sol, ve_nutriments_sol, ve_salinite,
56
							ve_humidite_atmos, ve_humidite_edaph, ve_reaction_sol, ve_nutriments_sol, ve_salinite,
51
							ve_texture_sol, ve_mat_org_sol ";
57
							ve_texture_sol, ve_mat_org_sol ";
52
						}else {
58
						}else {
53
							$e = 'Valeur de paramètre inconnue  pour \'test\'. ';
59
							$e = 'Valeur de paramètre inconnue  pour \'test\'. ';
54
							$this->renvoyerErreur(RestServeur::HTTP_CODE_MAUVAISE_REQUETE, $e);
60
							$this->renvoyerErreur(RestServeur::HTTP_CODE_MAUVAISE_REQUETE, $e);
55
						}
61
						}
56
						break;
62
						break;
-
 
63
					case 'retour.format'  :
-
 
64
						$this->retour_format = $valeur;
-
 
65
						break;
57
					default :
66
					default :
58
						$e = 'Erreur dans les parametres de votre requête : </br> Le paramètre " '
67
						$e = 'Erreur dans les parametres de votre requête : </br> Le paramètre " '
59
							.$param.' " n\'existe pas.';
68
							.$param.' " n\'existe pas.';
60
						$this->renvoyerErreur(RestServeur::HTTP_CODE_MAUVAISE_REQUETE, $e);	break;
69
						$this->renvoyerErreur(RestServeur::HTTP_CODE_MAUVAISE_REQUETE, $e);	break;
61
				}
70
				}
62
			}
71
			}
63
		}
72
		}
64
	}
73
	}
65
 
74
 
66
	public function traiterRessources() {
75
	public function traiterRessources() {
67
		if (isset($this->ressources) && !empty($this->ressources[0])) {
76
		if (isset($this->ressources) && !empty($this->ressources[0])) {
68
			if(preg_match('/^(.+)\.nn:([0-9]+)$/', $this->ressources[0], $retour)==1){
77
			if(preg_match('/^(.+)\.nn:([0-9]+)$/', $this->ressources[0], $retour)==1){
69
				switch ($retour[1]) {
78
				switch ($retour[1]) {
70
					case 'bdtfx' :
79
					case 'bdtfx' :
71
						$this->requete_condition[] = "num_nomen = ".$retour[2]." AND BDNT = 'BDTFX' ";
80
						$this->requete_condition[] = "num_nomen = ".$retour[2]." AND BDNT = 'BDTFX' ";
72
						 
81
						 
73
						break;
82
						break;
74
					case  'bdafx' :
83
					case  'bdafx' :
75
						$this->requete_condition[] = "num_nomen = ".$retour[2]." AND BDNT = 'BDAFX' "; 
84
						$this->requete_condition[] = "num_nomen = ".$retour[2]." AND BDNT = 'BDAFX' "; 
76
						break;
85
						break;
77
					case  'bdbfx' :
86
					case  'bdbfx' :
78
						$this->requete_condition[] = "num_nomen = ".$retour[2]." AND BDNT = 'BDBFX' "; 
87
						$this->requete_condition[] = "num_nomen = ".$retour[2]." AND BDNT = 'BDBFX' "; 
79
						break;
88
						break;
80
					default :
89
					default :
81
						$e = 'Erreur dans l\'url de votre requête : </br> La ressource " '
90
						$e = 'Erreur dans l\'url de votre requête : </br> La ressource " '
82
							.$retour[1].' " n\'existe pas.';
91
							.$retour[1].' " n\'existe pas.';
83
						$this->renvoyerErreur(RestServeur::HTTP_CODE_MAUVAISE_REQUETE, $e);	
92
						$this->renvoyerErreur(RestServeur::HTTP_CODE_MAUVAISE_REQUETE, $e);	
84
						break;
93
						break;
85
				}	
94
				}	
86
				
95
				
87
			}
96
			}
88
		} else {
97
		} else {
89
			$this->champs_recherches=" cle, catminat_code, BDNT, num_taxon, num_nomen ";
98
			$this->champs_recherches=" cle, catminat_code, BDNT, num_taxon, num_nomen ";
90
		}
99
		}
91
	}
100
	}
92
 
101
	
-
 
102
//+--------------------------formatages de resultats  -------------------------------------------+
93
	public function retournerResultatFormate($resultat) {
103
	public function retournerResultatFormate($resultat) {
94
		if ((count($this->ressources)) == 0){
104
		if ((count($this->ressources)) == 0) {
95
			$table_retour_json=array();
-
 
96
			$table_retour_json['entete'] = $this->ajouterEnteteResultat();
-
 
97
			$table_retour_json['resultat'] = $this->formaterResultats($resultat);
105
			$table_retour_json['resultat'] = $this->formaterResultats($resultat);
98
			
-
 
99
		} else {
106
		} else {
100
			$table_retour_json = $resultat[0];
107
			$table_retour_json = $this->formaterResultatsInformationsBDNTnn($resultat);
101
		}
108
		}
102
		return $table_retour_json;
109
		return $table_retour_json;
103
	}
110
	}
-
 
111
	
-
 
112
	public function formaterResultatsInformationsBDNTnn($resultat){
-
 
113
	$resultat_json=array();
-
 
114
	$resultat_json = $resultat[0];
-
 
115
	if ($this->retour_format == 'max'){ 
-
 
116
		if ($resultat_json['type_bio'] != ""){
-
 
117
			$tab_ontologie = $this->recupererOntologiePrTypeBio($resultat_json['type_bio']);
-
 
118
			unset($resultat_json['type_bio']);
-
 
119
			$resultat_json= array_merge($resultat_json,$tab_ontologie);
-
 
120
		}
-
 
121
		foreach ($this->champs_ontologiques as $cle => $valeur){
-
 
122
			if ($resultat_json[$cle] != ""){
-
 
123
				$tab_ontologie = $this->recupererOntologies($resultat_json[$cle], $cle);
-
 
124
				unset($resultat_json[$cle]);
-
 
125
				$resultat_json= array_merge($resultat_json,$tab_ontologie);
-
 
126
			}
-
 
127
		}
-
 
128
	}
-
 
129
	return $resultat_json;
-
 
130
	}
104
	
131
	
-
 
132
	public function formaterResultatsInformations($resultat) {
-
 
133
		$resultat_json=array();
105
	public function formaterResultats($resultat) {
134
		$resultat_json['entete'] = $this->ajouterEnteteResultat();
106
		foreach ($resultat as $tab) {
135
		foreach ($resultat as $tab) {
107
			$num = $tab['cle'];
136
			$num = $tab['cle'];
108
			unset($tab['cle']);
137
			unset($tab['cle']);
109
			foreach ($tab as $param => $valeur) {
138
			foreach ($tab as $param => $valeur) {
110
				$resultat_json[$num][$param] = $valeur;
139
				$resultat_json[$num][$param] = $valeur;
111
			}
140
			}
112
			$resultat_json[$num]['href'] = $this->ajouterHref('ontologies', $num);
141
			$resultat_json[$num]['href'] = $this->ajouterHref('ontologies', $num);
113
		}
142
		}
114
		return $resultat_json;
143
		return $resultat_json;
115
	}
144
	}
116
	public function ajouterEnteteResultat() {
145
	public function ajouterEnteteResultat() {
117
		
-
 
118
		$entete['depart'] = $this->limite_requete['depart'];
146
		$entete['depart'] = $this->limite_requete['depart'];
119
		$entete['limite'] = $this->limite_requete['limite'];
147
		$entete['limite'] = $this->limite_requete['limite'];
120
		$entete['total']  =  $this->total_resultat;
148
		$entete['total']  =  $this->total_resultat;
121
		$entete['version']  = $this->version_projet;
149
		$entete['version']  = $this->version_projet;
122
		$url = $this->formulerUrl($this->total_resultat, '/informations');
150
		$url = $this->formulerUrl($this->total_resultat, '/informations');
123
		if (isset($url['precedent']) && $url['precedent'] != '') {
151
		if (isset($url['precedent']) && $url['precedent'] != '') {
124
			$entete['href.precedent'] = $url['precedent'];
152
			$entete['href.precedent'] = $url['precedent'];
125
		}
153
		}
126
		if (isset($url['suivant']) && $url['suivant'] != '') {
154
		if (isset($url['suivant']) && $url['suivant'] != '') {
127
			$entete['href.suivant']   = $url['suivant'];
155
			$entete['href.suivant']   = $url['suivant'];
128
		}
156
		}
129
		
-
 
130
		return $entete;
157
		return $entete;
131
	}
158
	}
-
 
159
	
-
 
160
	
-
 
161
//+--------------------------traitement ontologies -------------------------------------------+
-
 
162
	public function recupererOntologies($valeur, $champs){
-
 
163
		$url = $this->ajouterHref('ontologies',$this->champs_ontologiques[$champs].':'.urlencode(urlencode($valeur)));
-
 
164
		$val = $this->consulterHref($url);
-
 
165
		$resultat_json[$champs.'.libelle'] = $val->nom;
-
 
166
		$resultat_json[$champs.'.code'] = $valeur;
-
 
167
		$resultat_json[$champs.'.href'] = $url;
-
 
168
		return $resultat_json;
-
 
169
	}
-
 
170
	
-
 
171
	
-
 
172
	
-
 
173
	public function recupererOntologiePrTypeBio($type_a_traiter){
-
 
174
		$resultat_typeBio = "";
-
 
175
		if ($type_a_traiter != ""){
-
 
176
			$resultat_typeBio['type_bio.code'] = $type_a_traiter;
-
 
177
			$types_prim_sec = $this->separerTypesPrimairesSecondaires($type_a_traiter);
-
 
178
			foreach ($types_prim_sec as $cle => $tb){
-
 
179
				$types_sstypes[$cle]= $this->separerTypes_SousTypes($tb, $cle);
-
 
180
			}
-
 
181
			switch (count($types_sstypes)){
-
 
182
				case 1 :
-
 
183
					$types_sstypes = $types_sstypes['principal'];
-
 
184
					break;
-
 
185
				case 2 : 
-
 
186
					$types_sstypes = array_merge($types_sstypes['principal'],$types_sstypes['secondaire']);
-
 
187
					break;
-
 
188
				case 3 : 
-
 
189
					$types_sstypes = array_merge($types_sstypes['principal'],
-
 
190
												$types_sstypes['secondaire'],
-
 
191
												$types_sstypes['special']);
-
 
192
					break;
-
 
193
			  default :
-
 
194
			  	break;
-
 
195
				 
-
 
196
			}
-
 
197
			
-
 
198
			foreach ($types_sstypes as $cle => $tb){
-
 
199
				if (($cle == 'type.principal') || ($cle == 'type.secondaire')){
-
 
200
					$url = $this->ajouterHref('ontologies','TB:'.urlencode(urlencode($tb)));
-
 
201
					$val = $this->consulterHref($url);
-
 
202
					$libelle[$cle]= $val->nom;
-
 
203
					$detail[$cle]['libelle'] = $val->nom;
-
 
204
					$detail[$cle]['code'] = $val->code;
-
 
205
					$detail[$cle]['href'] = $url;
-
 
206
				}
-
 
207
				if ( ($cle == 'sous_type.principal') || ($cle == 'sous_type.secondaire') || ($cle == 'sous_type.special') ){
-
 
208
					$i = 0; 
-
 
209
					foreach ($tb as $sstypes){
-
 
210
						$url = $this->ajouterHref('ontologies','ssTT:'.urlencode(urlencode($sstypes)));
-
 
211
						$val = $this->consulterHref($url);
-
 
212
						$libelle[$cle]=$val->nom;
-
 
213
						$detail[$cle][$i]['libelle'] = $val->nom;
-
 
214
						$detail[$cle][$i]['code'] = $val->code;
-
 
215
						$detail[$cle][$i]['href'] = $url;					
-
 
216
						$i++;
-
 
217
					}
-
 
218
				}
-
 
219
			}
-
 
220
		$resultat_typeBio['type_bio.libelle']= $this->formaterTypeBioPrLibelle($libelle);
-
 
221
		$resultat_typeBio['type_bio.detail'] = $detail;
-
 
222
		}
-
 
223
		return $resultat_typeBio;
-
 
224
	}
-
 
225
	
-
 
226
	
-
 
227
	public function formaterTypeBioPrLibelle($info){
-
 
228
		$libelle = $info['type.principal']." ";
-
 
229
		$libelle .= isset($info['sous_type.principal']) ? " (".$info['sous_type.principal'].") " : "";
-
 
230
		$libelle .= isset($info['type.secondaire']) ? ", ".$info['type.secondaire']." " : "";
-
 
231
		$libelle .= isset($info['sous_type.secondaire']) ? "(".$info['sous_type.secondaire'].") " : "";
-
 
232
		$libelle .= isset($info['sous_type.special']) ? "(".$info['sous_type.special'].") " : "";
-
 
233
		return $libelle;
-
 
234
	}
-
 
235
	
-
 
236
 
-
 
237
	public function separerTypesPrimairesSecondaires($type){
-
 
238
		$types = array(); 
-
 
239
		//séparation des principaux et des secondaires
-
 
240
		if (( preg_match("/(.+)\((.+)\)\-{0,1}(.+){0,1}/", $type,$retour) == 1  )){
-
 
241
			$types['principal'] = $retour[1]; 
-
 
242
			$types['secondaire'] = $retour[2];
-
 
243
			if (isset($retour[3])){$types['special'] = $retour[3];}
-
 
244
		}else {
-
 
245
			$types['principal'] = $type;
-
 
246
		}
-
 
247
		return $types;
-
 
248
	}
-
 
249
	
-
 
250
	public function separerTypes_SousTypes($type_a_traiter, $typePrimOuSec){
-
 
251
		$types = array();
-
 
252
		if(( preg_match("/^([a-zA-Zé]+)\-(.+)$|^([a-zA-Zé]+[^\-])$/", $type_a_traiter, $retour) == 1  )){
-
 
253
    		//recupère le type unique
-
 
254
		
-
 
255
			$type = (isset($retour[3]) && ($typePrimOuSec != 'special') ) ? $retour[3] : $retour[1] ;
-
 
256
			$types['type.'.$typePrimOuSec]= $type;
-
 
257
    		//recupère le ou les sous-types
-
 
258
    		if ((isset($retour[3]) && ($typePrimOuSec == 'special') )){
-
 
259
    			$ss_types[0] = (isset($retour[3]) && ($typePrimOuSec == 'special') ) ? $retour[3] : "" ;
-
 
260
    		}elseif(isset($retour[2]) && ($retour[2] != "")){
-
 
261
    			$ss_types[0]= (isset($retour[2]) && ($retour[2] != "") ) ? $retour[2] : "" ;
-
 
262
    		}
-
 
263
     		if (isset($ss_types[0])){
-
 
264
    			if (( preg_match("/\-/", $ss_types[0])) == 1 ){
-
 
265
    				$ss_types = preg_split("/\-/", $ss_types[0]);
-
 
266
    			}
-
 
267
				for($i = 0 ; $i < count($ss_types); $i++){
-
 
268
    				$types['sous_type.'.$typePrimOuSec][$i] = $ss_types[$i];
-
 
269
        			}
-
 
270
    		}
-
 
271
    	}
-
 
272
    	
132
	
273
 		return $types;
133
 
274
	}
134
	
275
	
135
	
276
	
136
	//+--------------------------FONCTIONS D'ASSEMBLAGE DE LA REQUETE-------------------------------------------+
277
//+--------------------------FONCTIONS D'ASSEMBLAGE DE LA REQUETE-------------------------------------------+
137
	
278
	
138
	public function assemblerLaRequete() {
279
	public function assemblerLaRequete() {
139
		$requete = 	' SELECT '.$this->champs_recherches.' FROM '.$this->table.' '
280
		$requete = 	' SELECT '.$this->champs_recherches.' FROM '.$this->table.' '
140
		.$this->retournerRequeteCondition().' '
281
		.$this->retournerRequeteCondition().' '
141
		.$this->delimiterResultatsRequete();
282
		.$this->delimiterResultatsRequete();
142
		return $requete;
283
		return $requete;
143
	}
284
	}
144
	
285
	
145
 
286
 
146
	
287
	
147
	public  function retournerRequeteCondition() {
288
	public  function retournerRequeteCondition() {
148
		$condition = '';
289
		$condition = '';
149
		if ($this->requete_condition !== "") {
290
		if ($this->requete_condition !== "") {
150
			$condition = ' WHERE '.implode(' AND ', $this->requete_condition);
291
			$condition = ' WHERE '.implode(' AND ', $this->requete_condition);
151
		}
292
		}
152
		return $condition;
293
		return $condition;
153
	}
294
	}
154
	
295
	
155
 
296
 
156
	
297
	
157
	public function calculerTotalResultat() {
298
	public function calculerTotalResultat() {
158
		//on récupère le nombre total de résultats de la requete
299
		//on récupère le nombre total de résultats de la requete
159
		$requete = 'SELECT count(*) as nombre FROM '.$this->table.' '
300
		$requete = 'SELECT count(*) as nombre FROM '.$this->table.' '
160
		.$this->retournerRequeteCondition();
301
		.$this->retournerRequeteCondition();
161
		$res = $this->getBdd()->recuperer($requete);
302
		$res = $this->getBdd()->recuperer($requete);
162
		if ($res) {
303
		if ($res) {
163
			$this->total_resultat = $res['nombre'];
304
			$this->total_resultat = $res['nombre'];
164
		} else {
305
		} else {
165
			$this->total_resultat = 0;
306
			$this->total_resultat = 0;
166
			$e = 'Données introuvables dans la base';
307
			$e = 'Données introuvables dans la base';
167
			$this->renvoyerErreur(RestServeur::HTTP_CODE_RESSOURCE_INTROUVABLE, $e);
308
			$this->renvoyerErreur(RestServeur::HTTP_CODE_RESSOURCE_INTROUVABLE, $e);
168
			Debug::printr($requete);
309
			Debug::printr($requete);
169
		}
310
		}
170
	}
311
	}
171
	
312
	
172
	public function delimiterResultatsRequete() {
313
	public function delimiterResultatsRequete() {
173
		$this->calculerTotalResultat();
314
		$this->calculerTotalResultat();
174
		if ((count($this->ressources)) == 0)  { 
315
		if ((count($this->ressources)) == 0)  { 
175
			if (($this->limite_requete['depart'] <  $this->total_resultat) && 
316
			if (($this->limite_requete['depart'] <  $this->total_resultat) && 
176
				(($this->limite_requete['depart'] + $this->limite_requete['limite'])
317
				(($this->limite_requete['depart'] + $this->limite_requete['limite'])
177
				< $this->total_resultat  )){ 
318
				< $this->total_resultat  )){ 
178
					$this->requete_limite = 'LIMIT '.$this->limite_requete['depart'].', '
319
					$this->requete_limite = 'LIMIT '.$this->limite_requete['depart'].', '
179
					.$this->limite_requete['limite'];
320
					.$this->limite_requete['limite'];
180
			}else {
321
			}else {
181
				$e = 'Données introuvables dans la base. ';
322
				$e = 'Données introuvables dans la base. ';
182
				$this->renvoyerErreur(RestServeur::HTTP_CODE_RESSOURCE_INTROUVABLE, $e);
323
				$this->renvoyerErreur(RestServeur::HTTP_CODE_RESSOURCE_INTROUVABLE, $e);
183
				}
324
				}
184
		}else {
325
		}else {
185
			$this->requete_limite='';
326
			$this->requete_limite='';
186
		}
327
		}
187
		return $this->requete_limite;
328
		return $this->requete_limite;
188
	}
329
	}
189
}
330
}