Subversion Repositories Applications.referentiel

Rev

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

Rev 235 Rev 236
Line 19... Line 19...
19
	
19
	
20
	/**
20
	/**
21
	 * Recherche un référentiel en fonction de paramètres
21
	 * Recherche un référentiel en fonction de paramètres
22
	 * @return le nombre de résultats répondant à la requête
22
	 * @return le nombre de résultats répondant à la requête
23
	 */
23
	 */
24
   public function chercherStructureNbre($type, $parametres) {
24
	public function chercherStructureNbre($type, $parametres) {
25
		$url = $this->construireUrlRecherche($type, $parametres, false);
25
		$url = $this->construireUrlRecherche($type, $parametres, false);
26
		$json = $this->envoyerRequeteConsultation($url);
26
		$json = $this->envoyerRequeteConsultation($url);
27
		$donnees = json_decode($json);
27
		$donnees = json_decode($json);
28
		return $donnees;
28
		return $donnees;
Line 29... Line 29...
29
	}
29
	}
30
	
30
	
31
	/**
31
	/**
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
	}
42
   
42
 
Line 43... Line 43...
43
   private function construireUrlRecherche($type, $parametres, $limitation = true) {
43
	private function construireUrlRecherche($type, $parametres, $limitation = true) {
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', 'pre', 'taxref');
46
		$params_a_passer = array('ref', 'mots', 'sg', 'gen', 'sp', 'ssp', 'au', 'an', 'nn', 'bib', 'nr', 'tax', 'pre', 'taxref');
Line 51... Line 51...
51
			} else {
51
			} else {
52
				$url .= '/*';
52
				$url .= '/*';
53
			}
53
			}
54
		}
54
		}
55
		return $url;
55
		return $url;
56
   }
56
	}
57
}
57
}
58
?>
58
?>
59
59