Subversion Repositories eFlore/Projets.eflore-projets

Rev

Rev 163 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

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