Subversion Repositories eFlore/Archives.eflore-consultation-v2

Rev

Rev 38 | Blame | Last modification | View Log | RSS feed

<?php

class collectionblockdedonnees{
    
    protected $identifiant;
    protected $collection;
    protected $erreur;
    
    function __construct($identifiant)
    {
        $this->identifiant = $identifiant;
        $this->collection = array();
    }
   
   function affecterIdentifiant($identifiant) 
    {
        $this->identifiant = $identifiant;
    }
    
    function ajouterDonnees($donnees)
    {
        $block = new blockdedonnees($this->identifiant);
        $block->affecterDonnees($donnees);
        $this->affecterBlockDeDonnees($block);
    }
    
    function affecterBlockDeDonnees($blockdonnees) 
    {
        array_push($this->collection,$blockdonnees);
    }
    
    function recupererBlocksDeDonnees()
    {
        return $this->collection;
    }
    
    function recupererIdentifiant()
    {
        return $this->identifiant;
    }
    
    function recupererErreur()
    {
        return $this->erreur;
    }
    
    function afficherPattern($chemin,$nom_fonction)
        {
                //echo "boucle</br>";
                for($i=0;$i<count($this->collection);$i++)
                {
                        $blockdonnees =$this->collection[$i];
                        $blockdonnees->afficherPattern($chemin,$nom_fonction);                  
                }
        }
    
    function afficher()
    {
        echo '<li><b>'.$this->identifiant.'</b></li>';
        for($i = 0; $i < count($this->collection); $i++) {
            $uneCollection = $this->collection[$i];
            $uneCollection->afficher();
        }
    }
}
?>