Subversion Repositories eFlore/Applications.cel

Rev

Rev 2458 | 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 gérant la completion des noms de lieux.
770 aurelien 5
 *
416 aurelien 6
 * Cas d'utilisation :
860 aurelien 7
 * Service completion nom de commune (plus tard de lieu en général)
416 aurelien 8
 *
860 aurelien 9
 * 1 : L'application recoit un debut de nom de lieu
2458 jpm 10
 * 2 : Si la longueur du prefixe est > 2, l'application retourne les 50 premieres lieux commencant par ce prefixe
11
 *
12
 * @internal   Mininum PHP version : 5.2
13
 * @category   CEL
14
 * @package    Services
15
 * @subpackage Auto-complétions
16
 * @version    0.1
17
 * @author     Mathias CHOUET <mathias@tela-botanica.org>
18
 * @author     Jean-Pascal MILCENT <jpm@tela-botanica.org>
19
 * @author     Aurelien PERONNET <aurelien@tela-botanica.org>
20
 * @license    GPL v3 <http://www.gnu.org/licenses/gpl.txt>
21
 * @license    CECILL v2 <http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt>
22
 * @copyright  1999-2014 Tela Botanica <accueil@tela-botanica.org>
23
 */
24
 
770 aurelien 25
class LocationSearch extends Cel {
416 aurelien 26
 
2458 jpm 27
	public function getElement($uid){
28
		$retour = array();
416 aurelien 29
 
770 aurelien 30
		if (isset($uid[0])) {
31
			$retour = $this->executerRequeteLieu($uid[0]);
32
		}
2458 jpm 33
 
34
		$this->envoyerJson($retour);
35
		return true;
416 aurelien 36
	}
37
 
2458 jpm 38
	public function getRessource() {
39
		print '[]';
40
		return;
416 aurelien 41
	}
2458 jpm 42
 
770 aurelien 43
	private function executerRequeteLieu($lieu) {
2557 aurelien 44
		$recherche_infos_zone_geo = new RechercheInfosZoneGeo($this->config);
45
		return $recherche_infos_zone_geo->obtenirListeInfosPourNom($lieu);
2458 jpm 46
	}
47
}