Rev 880 | Blame | Compare with Previous | Last modification | View Log | RSS feed
<?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;
}
}
}
}
?>