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;
|
|
|
9 |
|
|
|
10 |
public function __construct(NomDecorateur $nomDecorateur, $detailsHrefTpl) {
|
|
|
11 |
$this->nomDecorateur = $nomDecorateur;
|
|
|
12 |
$this->numNom = $this->nomDecorateur->nom->getTag('num_nom');
|
|
|
13 |
$this->numNomRetenu = $this->nomDecorateur->nom->getTag('num_nom_retenu');
|
202 |
jpm |
14 |
$this->nomSciRetenu = $this->nomDecorateur->nom->getTag('nr_nom_sci');
|
163 |
jpm |
15 |
$this->detailsHrefTpl = $detailsHrefTpl;
|
|
|
16 |
}
|
|
|
17 |
|
|
|
18 |
public function ajouterRetenu() {
|
|
|
19 |
$nn = (int) $this->numNom;
|
|
|
20 |
$nnr = (int) $this->numNomRetenu;
|
|
|
21 |
$this->nomDecorateur->nomFormate['retenu'] = ($nn == $nnr) ? true : false;
|
|
|
22 |
}
|
|
|
23 |
|
|
|
24 |
public function ajouterId() {
|
202 |
jpm |
25 |
if (empty($this->numNomRetenu) === false) {
|
|
|
26 |
$this->nomDecorateur->nomFormate['nom_retenu.id'] = (int) $this->numNomRetenu;
|
|
|
27 |
}
|
163 |
jpm |
28 |
}
|
|
|
29 |
|
|
|
30 |
public function ajouterHref() {
|
202 |
jpm |
31 |
if (empty($this->numNomRetenu) === false) {
|
|
|
32 |
$href = sprintf($this->detailsHrefTpl, $this->numNomRetenu);
|
|
|
33 |
$this->nomDecorateur->nomFormate['nom_retenu.href'] = $href;
|
|
|
34 |
}
|
163 |
jpm |
35 |
}
|
|
|
36 |
|
|
|
37 |
public function ajouterIntitule() {
|
202 |
jpm |
38 |
$this->nomDecorateur->nomFormate['nom_retenu'] = $this->nomSciRetenu;
|
163 |
jpm |
39 |
}
|
|
|
40 |
}
|
|
|
41 |
?>
|