163 |
jpm |
1 |
<?php
|
|
|
2 |
class NomDetails {
|
|
|
3 |
|
|
|
4 |
private $parametres = null;
|
|
|
5 |
private $ressources = null;
|
|
|
6 |
private $bdd = null;
|
|
|
7 |
private $detailsHrefTpl = null;
|
|
|
8 |
private $ontologieHrefTpl = null;
|
|
|
9 |
|
|
|
10 |
private $nom = array();
|
|
|
11 |
private $champsProjet = array();
|
|
|
12 |
|
|
|
13 |
public function __construct(Ressources $ressources, Parametres $parametres, Bdd $bdd) {
|
|
|
14 |
$this->ressources = $ressources;
|
|
|
15 |
$this->parametres = $parametres;
|
|
|
16 |
$this->bdd = $bdd;
|
|
|
17 |
}
|
|
|
18 |
|
|
|
19 |
public function setChampsProjets($champsProjet) {
|
|
|
20 |
$this->champsProjet = $champsProjet;
|
|
|
21 |
}
|
|
|
22 |
|
|
|
23 |
public function setDetailsHrefTpl($tpl) {
|
|
|
24 |
$this->detailsHrefTpl = $tpl;
|
|
|
25 |
}
|
|
|
26 |
|
|
|
27 |
public function setOntologieHrefTpl($tpl) {
|
|
|
28 |
$this->ontologieHrefTpl = $tpl;
|
|
|
29 |
}
|
|
|
30 |
|
|
|
31 |
public function consulter() {
|
|
|
32 |
$infos = $this->rechercherInfosNom();
|
|
|
33 |
$retour = $this->formaterDetails($infos);
|
|
|
34 |
return $retour;
|
|
|
35 |
}
|
|
|
36 |
|
|
|
37 |
private function rechercherInfosNom() {
|
|
|
38 |
$detailsId = $this->ressources->getDetailsId();
|
|
|
39 |
$detailsId = $this->bdd->proteger($detailsId);
|
|
|
40 |
$requete =
|
|
|
41 |
'SELECT ns.*, '.
|
|
|
42 |
' nr.nom_sci AS nr_nom_sci, nb.nom_sci AS nb_nom_sci '.
|
|
|
43 |
'FROM bdtfx_v1_01 AS ns '.
|
|
|
44 |
' LEFT JOIN bdtfx_v1_01 AS nr ON (ns.num_nom_retenu = nr.num_nom) '.
|
|
|
45 |
' LEFT JOIN bdtfx_v1_01 AS nb ON (ns.basionyme = nb.num_nom) '.
|
|
|
46 |
"WHERE ns.num_nom = $detailsId ";
|
|
|
47 |
$resultats = $this->bdd->recuperer($requete);
|
|
|
48 |
return $resultats;
|
|
|
49 |
}
|
|
|
50 |
|
|
|
51 |
private function formaterDetails($infos) {
|
|
|
52 |
$nomAFormater = new NomDO($infos);
|
|
|
53 |
$nomDeco = new NomDecorateur($nomAFormater);
|
|
|
54 |
$nomDeco->ajouterId();
|
|
|
55 |
$nomDeco->ajouterIntitule();
|
|
|
56 |
|
|
|
57 |
$retenuDeco = new NomRetenuDecorateur($nomDeco, $this->detailsHrefTpl);
|
|
|
58 |
$retenuDeco->ajouterRetenu();
|
|
|
59 |
$retenuDeco->ajouterId();
|
|
|
60 |
$retenuDeco->ajouterIntitule();
|
|
|
61 |
$retenuDeco->ajouterHref();
|
|
|
62 |
|
|
|
63 |
$rangDeco = new NomRangDecorateur($nomDeco, $this->bdd, $this->ontologieHrefTpl);
|
|
|
64 |
$rangDeco->ajouterCode();
|
|
|
65 |
$rangDeco->ajouterIntitule();
|
|
|
66 |
$rangDeco->ajouterHref();
|
|
|
67 |
|
|
|
68 |
$compoDeco = new NomCompoDecorateur($nomDeco);
|
|
|
69 |
$compoDeco->ajouterCompo();
|
|
|
70 |
|
|
|
71 |
$nomDeco->ajouterAuteur();
|
|
|
72 |
$nomDeco->ajouterAnnee();
|
|
|
73 |
$nomDeco->ajouterBiblio();
|
|
|
74 |
$nomDeco->ajouterAddendum();
|
|
|
75 |
$nomDeco->ajouterNotes();
|
|
|
76 |
|
|
|
77 |
$basioDeco = new NomBasionymeDecorateur($nomDeco, $this->detailsHrefTpl);
|
|
|
78 |
$basioDeco->ajouterId();
|
|
|
79 |
$basioDeco->ajouterIntitule();
|
|
|
80 |
$basioDeco->ajouterHref();
|
|
|
81 |
|
|
|
82 |
$projetDeco = new NomChampsProjetDecorateur($nomDeco, $this->champsProjet);
|
|
|
83 |
$projetDeco->ajouterChampsSupplementaires();
|
|
|
84 |
|
|
|
85 |
return $nomDeco->getNomFormate();
|
|
|
86 |
}
|
|
|
87 |
}
|
|
|
88 |
?>
|