Subversion Repositories eFlore/Applications.cel

Rev

Rev 1527 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
416 aurelien 1
<?php
2458 jpm 2
// declare(encoding='UTF-8');
416 aurelien 3
/**
2458 jpm 4
 * Service de complétion du nom scientifique.
5
 *
6
 * Cas d'utilisation :
7
 * 1 : L'application recoit un debut de nom scientifique ainsi qu'un code de référentiel
8
 * 2 : Si le genre recu est >1, l'application retourne les 50 premieres genre commencant par ce prefixe
9
 * 3 : Si l'espece est presente  l'application retourne les 50 premieres genre+espece commencant par ce prefixe
10
 *
11
 * @internal   Mininum PHP version : 5.2
12
 * @category   CEL
13
 * @package    Services
14
 * @subpackage Auto-complétions
15
 * @version    0.1
16
 * @author     Mathias CHOUET <mathias@tela-botanica.org>
17
 * @author     Jean-Pascal MILCENT <jpm@tela-botanica.org>
18
 * @author     Aurelien PERONNET <aurelien@tela-botanica.org>
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>
21
 * @copyright  1999-2014 Tela Botanica <accueil@tela-botanica.org>
22
 */
892 aurelien 23
class NameSearch extends Cel {
2458 jpm 24
 
892 aurelien 25
	public function getRessource(){
2458 jpm 26
		//TODO: description du service à renvoyer
27
		print '[]';
28
		return;
416 aurelien 29
	}
30
 
892 aurelien 31
	public function getElement($uid){
2458 jpm 32
		$referentiel = isset($uid[0]) ? $uid[0] : null;
33
		$genre = isset($uid[1]) ? $uid[1] : null;
34
		$espece = isset($uid[2]) ? $uid[2] : null;
1426 aurelien 35
 
1527 aurelien 36
		$chercheur_infos_taxon = new RechercheInfosTaxonBeta($this->config, $referentiel);
892 aurelien 37
		$liste_genre_espece = $chercheur_infos_taxon->rechercherGenreEspeceSurPrefixe($genre,$espece);
2458 jpm 38
		$this->envoyerJson($liste_genre_espece);
39
		return true;
892 aurelien 40
	}
2458 jpm 41
}