29,19 → 29,37 |
$this->donnees = $donnees; |
} |
|
function recupererDonnees() |
function recupererDonnees($bool_descendance = FALSE) |
{ |
return $this->donnees; |
if ($bool_descendance == TRUE) { |
$aso_donnees = array(); |
$aso_donnees[$this->recupererIdentifiant()] = $this->donnees; |
$collections_blocks_fils = $this->recupererCollectionBlockFils(); |
if (is_array($collections_blocks_fils)) { |
for($i = 0; $i < count($collections_blocks_fils); $i++) { |
$collection = $collections_blocks_fils[$i]; |
$blocks_de_donnees = $collection->recupererBlocksDeDonnees(); |
for($j = 0; $j < count($blocks_de_donnees); $j++) { |
$block = $blocks_de_donnees[$j]; |
$donnees = $block->recupererDonnees(); |
$aso_donnees[$this->recupererIdentifiant()][$block->recupererIdentifiant()] = $donnees; |
} |
} |
} |
return $aso_donnees; |
} else { |
return $this->donnees; |
} |
} |
|
function ajouterDonnee($clef, $valeur) |
{ |
$this->donnees["$clef"] = $valeur; |
$this->donnees[$clef] = $valeur; |
} |
|
function recupererDonnee($clef) |
{ |
return $this->donnees["$clef"]; |
return $this->donnees[$clef]; |
} |
|
function recupererErreur() |
49,11 → 67,6 |
return $this->erreur; |
} |
|
function recupererBlockFils() |
{ |
return $this->blocksfils; |
} |
|
function ajouterCollectionBlockFils($collection_block) |
{ |
array_push($this->collectionBlocksfils, $collection_block); |
64,11 → 77,11 |
return $this->collectionBlocksfils; |
} |
|
function afficherPattern($chemin, $nom_fonction) |
function afficherPattern($chemin, $nom_fonction, $recuperer_descendance = FALSE, $aso_parametres = array()) |
{ |
$retour = ''; |
if($chemin == $this->recupererIdentifiant()) { |
$retour .= call_user_func($nom_fonction, $this->recupererDonnees()); |
$retour .= call_user_func($nom_fonction, $this->recupererDonnees($recuperer_descendance), $aso_parametres); |
} else { |
$etape_chemin = explode('>', $chemin); |
if($this->identifiant == $etape_chemin[0]) { |
77,7 → 90,7 |
$collection = $collection_block_fils[$i]; |
if ($collection->recupererIdentifiant() == $etape_chemin[1]) { |
array_shift($etape_chemin); |
$retour .= $collection->afficherPattern(implode('>', $etape_chemin), $nom_fonction); |
$retour .= $collection->afficherPattern(implode('>', $etape_chemin), $nom_fonction, $recuperer_descendance, $aso_parametres); |
} |
} |
} |