Subversion Repositories eFlore/Projets.eflore-projets

Compare Revisions

Ignore whitespace Rev 842 → Rev 843

/tags/v0.1-20130829/services/bibliotheque/ontologie/decorateurs/OntologieChampsProjetDecorateur.php
New file
0,0 → 1,38
<?php
class OntologieChampsProjetDecorateur extends OntologieDecorateur {
 
private $ontologieDecorateur = null;
private $champs = array();
protected $correspondances = array();
 
public function __construct(OntologieDecorateur $ontologieDecorateur, Array $champs) {
$this->ontologieDecorateur = $ontologieDecorateur;
$this->champs = $champs;
$this->correspondances = array_flip($this->champs);
}
 
public function traiterChampsRetour(Array $champsRetour) {
//die(print_r($this->correspondances,true));
foreach ($champsRetour as $champ) {
if (array_key_exists($champ, $this->correspondances)) {
$champBdd = $this->correspondances[$champ];
$champSortie = $champ;
//die(print_r($this->ontologieDecorateur->terme,true));
if ($this->ontologieDecorateur->terme->verifierTag($champBdd)) {
$valeur = $this->ontologieDecorateur->terme->getTag($champBdd);
$this->ontologieDecorateur->termeFormate[$champSortie] = $valeur;
}
}
}
}
 
public function ajouterChampsSupplementaires() {
foreach ($this->champs as $champBdd => $champSortie) {
if ($this->ontologieDecorateur->terme->verifierTag($champBdd)) {
$valeur = $this->ontologieDecorateur->terme->getTag($champBdd);
$this->ontologieDecorateur->termeFormate[$champSortie] = $valeur;
}
}
}
}
?>