163 |
jpm |
1 |
<?php
|
|
|
2 |
class NomRetenuDecorateur extends NomDecorateur {
|
|
|
3 |
|
|
|
4 |
private $nomDecorateur = null;
|
|
|
5 |
private $numNom = null;
|
|
|
6 |
private $numNomRetenu = null;
|
202 |
jpm |
7 |
private $nomSciRetenu = null;
|
163 |
jpm |
8 |
private $detailsHrefTpl = null;
|
207 |
jpm |
9 |
protected $correspondances = array(
|
|
|
10 |
'retenu' => 'Retenu',
|
|
|
11 |
'nom_retenu' => 'Intitule',
|
|
|
12 |
'nom_retenu.id' => 'Id',
|
|
|
13 |
'nom_retenu.href' => 'Href',
|
|
|
14 |
'nom_retenu.*' => 'Intitule,Id,Href');
|
163 |
jpm |
15 |
|
|
|
16 |
public function __construct(NomDecorateur $nomDecorateur, $detailsHrefTpl) {
|
|
|
17 |
$this->nomDecorateur = $nomDecorateur;
|
|
|
18 |
$this->numNom = $this->nomDecorateur->nom->getTag('num_nom');
|
|
|
19 |
$this->numNomRetenu = $this->nomDecorateur->nom->getTag('num_nom_retenu');
|
202 |
jpm |
20 |
$this->nomSciRetenu = $this->nomDecorateur->nom->getTag('nr_nom_sci');
|
163 |
jpm |
21 |
$this->detailsHrefTpl = $detailsHrefTpl;
|
|
|
22 |
}
|
|
|
23 |
|
|
|
24 |
public function ajouterRetenu() {
|
|
|
25 |
$nn = (int) $this->numNom;
|
|
|
26 |
$nnr = (int) $this->numNomRetenu;
|
|
|
27 |
$this->nomDecorateur->nomFormate['retenu'] = ($nn == $nnr) ? true : false;
|
|
|
28 |
}
|
|
|
29 |
|
|
|
30 |
public function ajouterId() {
|
202 |
jpm |
31 |
if (empty($this->numNomRetenu) === false) {
|
|
|
32 |
$this->nomDecorateur->nomFormate['nom_retenu.id'] = (int) $this->numNomRetenu;
|
|
|
33 |
}
|
163 |
jpm |
34 |
}
|
|
|
35 |
|
|
|
36 |
public function ajouterHref() {
|
202 |
jpm |
37 |
if (empty($this->numNomRetenu) === false) {
|
|
|
38 |
$href = sprintf($this->detailsHrefTpl, $this->numNomRetenu);
|
|
|
39 |
$this->nomDecorateur->nomFormate['nom_retenu.href'] = $href;
|
|
|
40 |
}
|
163 |
jpm |
41 |
}
|
|
|
42 |
|
|
|
43 |
public function ajouterIntitule() {
|
202 |
jpm |
44 |
$this->nomDecorateur->nomFormate['nom_retenu'] = $this->nomSciRetenu;
|
163 |
jpm |
45 |
}
|
|
|
46 |
}
|
|
|
47 |
?>
|