Subversion Repositories eFlore/Applications.eflore-consultation

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
990 isa 1
<?php
2
// declare(encoding='UTF-8');
3
/**
4
 * Classe mère du module Liste.
5
 *
6
 * @category	PHP 5.2
7
 * @package		eflore-consultation
8
 * @author		Jean-Pascal MILCENT <jpm@tela-botanica.org>
9
 * @author		Delphine CAUQUIL <delphine@tela-botanica.org>
10
 * @copyright	2011 Tela-Botanica
11
 * @license		http://www.gnu.org/licenses/gpl.html Licence GNU-GPL-v3
12
 * @license		http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL-v2
13
 * @version		$Id$
14
 */
15
class NomsCommuns extends aControleur {
16
 
17
	private $conteneur = null;
18
	private $nomCourant = null;
19
	private $nomsVernaculaires = null;
20
	private $referentiel = 'bdtfx';
21
	private $donnees = array();
22
 
23
	public function __construct(Conteneur $conteneur) {
24
		$this->conteneur = $conteneur;
25
		$this->nomCourant = $this->conteneur->getNomCourant();
26
		$this->nomsVernaculaires = $this->conteneur->getApiNomsVernaculaires();
27
		$this->referentiel = $this->conteneur->getParametre('referentiel');
28
	}
29
 
30
	public function getDonnees() {
31
		$nt = $this->nomCourant->getNomRetenu()->get('num_taxonomique');
32
		$projet = Config::get($this->referentiel.'.referentielVerna');
33
		if ($projet != '') {
34
			$nomsVerna = $this->nomsVernaculaires->getRechercheLimitee($projet, $nt);
35
			$this->donnees = (isset($nomsVerna['resultat']) && is_array($nomsVerna['resultat'])) ? array_slice($nomsVerna['resultat'], 0, 1) : array();
36
		}
37
		return $this->donnees;
38
	}
39
}
40
?>