Subversion Repositories eFlore/Projets.eflore-projets

Rev

Rev 277 | Rev 280 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 277 Rev 279
Line 42... Line 42...
42
	protected $requete_condition = '';
42
	protected $requete_condition = '';
43
	protected $limite_requete = array(
43
	protected $limite_requete = array(
44
		'depart' => 0,
44
		'depart' => 0,
45
		'limite' => 100
45
		'limite' => 100
46
	);
46
	);
-
 
47
	
-
 
48
	protected $champ_tri = 'code_langue';
-
 
49
	protected $direction_tri = 'asc';
Line 47... Line 50...
47
 
50
 
48
	/**
51
	/**
49
	 * Precise la contenance plus ou moins précise du tableau à retourner :
52
	 * Precise la contenance plus ou moins précise du tableau à retourner :
50
	 *  - min = les données présentes dans la table
53
	 *  - min = les données présentes dans la table
Line 350... Line 353...
350
				// traiter qu'une ligne à la fois (i.e.: la ligne en cours dans $tab), ce qui serait bien plus rapide
353
				// traiter qu'une ligne à la fois (i.e.: la ligne en cours dans $tab), ce qui serait bien plus rapide
351
				$resultat_json = $this->afficherTaxonsAttributions($resultat_json);
354
				$resultat_json = $this->afficherTaxonsAttributions($resultat_json);
352
				$resultat_json[$tab['num_nom_vernaculaire']] = $this->afficherChampsSupplementairesOntologie($tab);
355
				$resultat_json[$tab['num_nom_vernaculaire']] = $this->afficherChampsSupplementairesOntologie($tab);
353
			}
356
			}
354
		}
357
		}
355
				
-
 
-
 
358
		uasort($resultat_json, array($this,'trierLigneTableau'));
356
		$table_retour_json['resultat'] = $resultat_json;
359
		$table_retour_json['resultat'] = $resultat_json;
357
		return $table_retour_json;
360
		return $table_retour_json;
358
	}
361
	}
Line 359... Line 362...
359
	
362
	
Line 391... Line 394...
391
			}
394
			}
392
		}
395
		}
393
		return $resultat;
396
		return $resultat;
394
	}
397
	}
Line -... Line 398...
-
 
398
	
-
 
399
	private function trierLigneTableau($a, $b) {
-
 
400
		if ($a[$this->champ_tri] == $b[$this->champ_tri]) return 0;
-
 
401
		if($this->direction_tri == 'asc') {
-
 
402
			return ($a[$this->champ_tri] < $b[$this->champ_tri]) ? -1 : 1;
-
 
403
		} else {
-
 
404
			return ($a[$this->champ_tri] > $b[$this->champ_tri]) ? -1 : 1;
-
 
405
		}	
-
 
406
	}
395
	
407
	
396
	// formatage de la reponse /id ss la forme
408
	// formatage de la reponse /id ss la forme
397
	// id, nom_vernaculaire, attributions
409
	// id, nom_vernaculaire, attributions
398
	// langue
410
	// langue
399
	// num_nom (correspond à un taxon bdtfx)
411
	// num_nom (correspond à un taxon bdtfx)