Subversion Repositories Applications.referentiel

Compare Revisions

Ignore whitespace Rev 75 → Rev 76

/trunk/bibliotheque/dao/TaxonDao.php
New file
0,0 → 1,44
<?php
// declare(encoding='UTF-8');
/**
* DAO des Taxons pour le module Taxons.
*
* @package Taxon
* @category php 5.2
* @author Jean-Pascal MILCENT <jpm@tela-botanica.org>
* @copyright 2010 Tela-Botanica
* @license http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
* @license http://www.gnu.org/licenses/gpl.html Licence GNU-GPL
* @version SVN: $Id: TaxonDao.php 151 2010-09-06 16:03:09Z jpm $
*
*/
class TaxonDao extends Dao {
const SERVICE = 'FicheTaxon';
/**
* Retourne l'ensemble des information sur un taxon.
*
* @param integer le numéro du taxon.
* @return array un tableau contenant les informations sur la taxon.
*/
public function getTaxon($ref, $id) {
$url = $this->url_jrest.self::SERVICE."/Taxon/$ref/$id";
$json = $this->envoyerRequeteConsultation($url);
$donnees = json_decode($json, true);
return $donnees['taxons'];
}
public function getNomenclature($ref, $id) {
$url = $this->url_jrest.self::SERVICE."/Nomenclature/$ref/$id";
$json = $this->envoyerRequeteConsultation($url);
$resultats = json_decode($json, true);
return $resultats[0];
}
public function getParentsHybride($ref, $id) {
$url = $this->url_jrest.self::SERVICE."/ParentsHybride/$ref/$id";
$json = $this->envoyerRequeteConsultation($url);
$parents = json_decode($json, true);
return $parents[0];
}
}
?>