Subversion Repositories eFlore/Projets.eflore-projets

Rev

Rev 163 | Go to most recent revision | Show entire file | Ignore 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 {
3
	
3
 
4
	private $nomDecorateur = null;
4
	private $nomDecorateur = null;
5
	private $champs = array();
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) {
8
		$this->nomDecorateur = $nomDecorateur;
9
		$this->nomDecorateur = $nomDecorateur;
9
		$this->champs = $champs;
10
		$this->champs = $champs;
-
 
11
		$this->correspondances = array_flip($this->champs);
10
	}
12
	}
11
	
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
				}
-
 
23
			}
-
 
24
		}
-
 
25
	}
-
 
26
 
12
	public function ajouterChampsSupplementaires() {
27
	public function ajouterChampsSupplementaires() {
13
		foreach ($this->champs as $champBdd => $champSortie) {
28
		foreach ($this->champs as $champBdd => $champSortie) {
14
			if ($this->nomDecorateur->nom->verifierTag($champBdd)) {
29
			if ($this->nomDecorateur->nom->verifierTag($champBdd)) {
15
				$valeur = $this->nomDecorateur->nom->getTag($champBdd);
30
				$valeur = $this->nomDecorateur->nom->getTag($champBdd);
16
				$this->nomDecorateur->nomFormate[$champSortie] = $valeur;
31
				$this->nomDecorateur->nomFormate[$champSortie] = $valeur;