Subversion Repositories eFlore/Archives.eflore-consultation-v2

Rev

Rev 36 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
36 jpm 1
<?php
27 jpm 2
 
3
class collectionblockdedonnees{
4
 
5
    protected $identifiant;
6
    protected $collection;
7
    protected $erreur;
8
 
38 jpm 9
    function __construct($identifiant)
10
    {
11
        $this->identifiant = $identifiant;
12
        $this->collection = array();
13
    }
27 jpm 14
 
15
   function affecterIdentifiant($identifiant)
38 jpm 16
    {
27 jpm 17
        $this->identifiant = $identifiant;
18
    }
19
 
20
    function ajouterDonnees($donnees)
21
    {
22
        $block = new blockdedonnees($this->identifiant);
23
        $block->affecterDonnees($donnees);
24
        $this->affecterBlockDeDonnees($block);
25
    }
38 jpm 26
 
27 jpm 27
    function affecterBlockDeDonnees($blockdonnees)
38 jpm 28
    {
27 jpm 29
        array_push($this->collection,$blockdonnees);
30
    }
31
 
32
    function recupererBlocksDeDonnees()
33
    {
34
        return $this->collection;
35
    }
36
 
37
    function recupererIdentifiant()
38
    {
36 jpm 39
        return $this->identifiant;
27 jpm 40
    }
41
 
42
    function recupererErreur()
43
    {
44
        return $this->erreur;
45
    }
46
 
47
    function afficher()
48
    {
38 jpm 49
        echo '<li><b>'.$this->identifiant.'</b></li>';
50
        for($i = 0; $i < count($this->collection); $i++) {
51
            $uneCollection = $this->collection[$i];
27 jpm 52
            $uneCollection->afficher();
53
        }
54
    }
55
}
56
?>