Subversion Repositories eFlore/Archives.eflore-consultation-v2

Rev

Rev 36 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

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