Subversion Repositories eFlore/Applications.coel-consultation

Rev

Rev 10 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
7 jpm 1
<?php
2
// declare(encoding='UTF-8');
3
/**
4
 * Modèle d'accès à la base de données des Collections pour la Recherche
5
 *
6
 * @package		Collection
7
 * @category	php5
8
 * @author		aurelien <aurelien@tela-botanica.org>
9
 * @copyright	2010 Tela-Botanica
10
 * @license		http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
11
 * @license		http://www.gnu.org/licenses/gpl.html Licence GNU-GPL
12
 * @version		SVN: $Id: RechercheDao.php 19 2010-03-24 18:22:25Z jpm $
13
 *
14
 */
15
class RechercheDao extends ColModele {
19 jpm 16
	const SERVICE = 'CoelRecherche';
17
 
7 jpm 18
	/**
19
	 * Recherche une collection en fonction de paramêtres
20
	 * @return array un tableau contenant des objets d'informations sur les collections
21
	 */
22
   public function chercherStructureNbre($parametres) {
19 jpm 23
		$mots = urlencode($parametres['mots']);
24
   		$url = $this->url_jrest.self::SERVICE."/Nombre/$mots";
25
   		$json = file_get_contents($url);
26
		$donnees = json_decode($json);
27
		return $donnees;
7 jpm 28
	}
29
 
30
	/**
31
	 * Recherche une collection en fonction de paramêtres
32
	 * @return array un tableau contenant des objets d'informations sur les collections
33
	 */
34
   public function chercher($parametres) {
19 jpm 35
		$mots = urlencode($parametres['mots']);
36
   		$url = $this->url_jrest.self::SERVICE."/ParDefaut/$mots";
37
		$url .= ($this->avoirLimitation() ? "?start={$this->getLimiteDebut()}&limit={$this->getLimiteNbre()}" : '');
38
   		$json = file_get_contents($url);
39
		$donnees = json_decode($json, true);
7 jpm 40
		return $donnees;
19 jpm 41
   }
7 jpm 42
}
43
?>