Subversion Repositories eFlore/Projets.eflore-projets

Rev

Rev 163 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 163 Rev 207
Line 1... Line 1...
1
<?php
1
<?php
2
class NomChampsProjetDecorateur extends NomDecorateur {
2
class NomChampsProjetDecorateur extends NomDecorateur {
Line 3... Line 3...
3
	
3
 
4
	private $nomDecorateur = null;
4
	private $nomDecorateur = null;
-
 
5
	private $champs = array();
Line 5... Line 6...
5
	private $champs = array();
6
	protected $correspondances = array();
6
	
7
 
7
	public function __construct(NomDecorateur $nomDecorateur, Array $champs) {
8
	public function __construct(NomDecorateur $nomDecorateur, Array $champs) {
-
 
9
		$this->nomDecorateur = $nomDecorateur;
-
 
10
		$this->champs = $champs;
-
 
11
		$this->correspondances = array_flip($this->champs);
-
 
12
	}
-
 
13
 
-
 
14
	public function traiterChampsRetour(Array $champsRetour) {
-
 
15
		foreach ($champsRetour as $champ) {
-
 
16
			if (array_key_exists($champ, $this->correspondances)) {
-
 
17
				$champBdd = $this->correspondances[$champ];
-
 
18
				$champSortie = $champ;
-
 
19
				if ($this->nomDecorateur->nom->verifierTag($champBdd)) {
-
 
20
					$valeur = $this->nomDecorateur->nom->getTag($champBdd);
-
 
21
					$this->nomDecorateur->nomFormate[$champSortie] = $valeur;
-
 
22
				}
8
		$this->nomDecorateur = $nomDecorateur;
23
			}
Line 9... Line 24...
9
		$this->champs = $champs;
24
		}
10
	}
25
	}
11
	
26