Blame | Last modification | View Log | RSS feed
<?php
class NomDetails {
private $parametres = null;
private $ressources = null;
private $bdd = null;
private $detailsHrefTpl = null;
private $ontologieHrefTpl = null;
private $nom = array();
private $champsProjet = array();
public function __construct(Ressources $ressources, Parametres $parametres, Bdd $bdd) {
$this->ressources = $ressources;
$this->parametres = $parametres;
$this->bdd = $bdd;
}
public function setChampsProjets($champsProjet) {
$this->champsProjet = $champsProjet;
}
public function setDetailsHrefTpl($tpl) {
$this->detailsHrefTpl = $tpl;
}
public function setOntologieHrefTpl($tpl) {
$this->ontologieHrefTpl = $tpl;
}
public function consulter() {
$infos = $this->rechercherInfosNom();
$retour = $this->formaterDetails($infos);
return $retour;
}
private function rechercherInfosNom() {
$detailsId = $this->ressources->getDetailsId();
$detailsId = $this->bdd->proteger($detailsId);
$requete =
'SELECT ns.*, '.
' nr.nom_sci AS nr_nom_sci, nb.nom_sci AS nb_nom_sci '.
'FROM bdtfx_v1_01 AS ns '.
' LEFT JOIN bdtfx_v1_01 AS nr ON (ns.num_nom_retenu = nr.num_nom) '.
' LEFT JOIN bdtfx_v1_01 AS nb ON (ns.basionyme = nb.num_nom) '.
"WHERE ns.num_nom = $detailsId ";
$resultats = $this->bdd->recuperer($requete);
return $resultats;
}
private function formaterDetails($infos) {
$nomAFormater = new NomDO($infos);
$nomDeco = new NomDecorateur($nomAFormater);
$nomDeco->ajouterId();
$nomDeco->ajouterIntitule();
$retenuDeco = new NomRetenuDecorateur($nomDeco, $this->detailsHrefTpl);
$retenuDeco->ajouterRetenu();
$retenuDeco->ajouterId();
$retenuDeco->ajouterIntitule();
$retenuDeco->ajouterHref();
$rangDeco = new NomRangDecorateur($nomDeco, $this->bdd, $this->ontologieHrefTpl);
$rangDeco->ajouterCode();
$rangDeco->ajouterIntitule();
$rangDeco->ajouterHref();
$compoDeco = new NomCompoDecorateur($nomDeco);
$compoDeco->ajouterCompo();
$nomDeco->ajouterAuteur();
$nomDeco->ajouterAnnee();
$nomDeco->ajouterBiblio();
$nomDeco->ajouterAddendum();
$nomDeco->ajouterNotes();
$basioDeco = new NomBasionymeDecorateur($nomDeco, $this->detailsHrefTpl);
$basioDeco->ajouterId();
$basioDeco->ajouterIntitule();
$basioDeco->ajouterHref();
$projetDeco = new NomChampsProjetDecorateur($nomDeco, $this->champsProjet);
$projetDeco->ajouterChampsSupplementaires();
return $nomDeco->getNomFormate();
}
}
?>