Subversion Repositories Applications.referentiel

Rev

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

Rev 232 Rev 235
Line 32... Line 32...
32
	 * Recherche un référentiel en fonction de paramêtres
32
	 * Recherche un référentiel en fonction de paramêtres
33
	 * @return array un tableau contenant des objets d'informations sur les taxons
33
	 * @return array un tableau contenant des objets d'informations sur les taxons
34
	 */
34
	 */
35
   public function chercher($type, $parametres) {
35
   public function chercher($type, $parametres) {
36
   		$this->ordre['nom_sci'] = 'ASC';
36
   		$this->ordre['nom_sci'] = 'ASC';
37
		$url = $this->construireUrlRecherche($type, $parametres);		
37
		$url = $this->construireUrlRecherche($type, $parametres);
38
   		$json = $this->envoyerRequeteConsultation($url);
38
   		$json = $this->envoyerRequeteConsultation($url);
39
   		$donnees = json_decode($json, true);		
39
   		$donnees = json_decode($json, true);
40
		return $donnees;
40
		return $donnees;
41
   }
41
   }
Line 42... Line 42...
42
   
42
   
43
   private function construireUrlRecherche($type, $parametres, $limitation = true) {
43
   private function construireUrlRecherche($type, $parametres, $limitation = true) {
Line 44... Line 44...
44
   		$url = $this->url_jrest.self::SERVICE.'/'.$type;
44
   		$url = $this->url_jrest.self::SERVICE.'/'.$type;
45
		
45
		
46
		$params_a_passer = array('ref', 'mots', 'sg', 'gen', 'sp', 'ssp', 'au', 'an', 'nn', 'bib', 'nr', 'tax');
46
		$params_a_passer = array('ref', 'mots', 'sg', 'gen', 'sp', 'ssp', 'au', 'an', 'nn', 'bib', 'nr', 'tax', 'pre', 'taxref');
47
		foreach ($params_a_passer as $param_cle) {
47
		foreach ($params_a_passer as $param_cle) {
48
			if (isset($parametres[$param_cle]) && $parametres[$param_cle] != '') {
48
			if (isset($parametres[$param_cle]) && $parametres[$param_cle] != '') {
49
				$valeur = urlencode(trim($parametres[$param_cle]));
49
				$valeur = urlencode(trim($parametres[$param_cle]));