163 |
jpm |
1 |
<?php
|
|
|
2 |
class NomRetenuDecorateur extends NomDecorateur {
|
|
|
3 |
|
|
|
4 |
private $nomDecorateur = null;
|
|
|
5 |
private $numNom = null;
|
|
|
6 |
private $numNomRetenu = null;
|
|
|
7 |
private $nomSci = null;
|
|
|
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');
|
|
|
14 |
$this->nomSci = $this->nomDecorateur->nom->getTag('nr_nom_sci');
|
|
|
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() {
|
|
|
25 |
$this->nomDecorateur->nomFormate['nom_retenu.id'] = (int) $this->numNomRetenu;
|
|
|
26 |
}
|
|
|
27 |
|
|
|
28 |
public function ajouterHref() {
|
|
|
29 |
$href = sprintf($this->detailsHrefTpl, $this->numNomRetenu);
|
|
|
30 |
$this->nomDecorateur->nomFormate['nom_retenu.href'] = $href;
|
|
|
31 |
}
|
|
|
32 |
|
|
|
33 |
public function ajouterIntitule() {
|
|
|
34 |
$this->nomDecorateur->nomFormate['nom_retenu'] = $this->nomSci;
|
|
|
35 |
}
|
|
|
36 |
}
|
|
|
37 |
?>
|