Subversion Repositories eFlore/Archives.eflore-consultation-v2

Rev

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

Rev 27 Rev 36
1
<?
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
        
25
        
26
    }
26
    }
27
   
27
   
28
    function affecterBlockDeDonnees($blockdonnees) 
28
    function affecterBlockDeDonnees($blockdonnees) 
29
    { 
29
    { 
30
        array_push($this->collection,$blockdonnees);
30
        array_push($this->collection,$blockdonnees);
31
    }
31
    }
32
    
32
    
33
    function recupererBlocksDeDonnees()
33
    function recupererBlocksDeDonnees()
34
    {
34
    {
35
        return $this->collection;
35
        return $this->collection;
36
    }
36
    }
37
    
37
    
38
    function recupererIdentifiant()
38
    function recupererIdentifiant()
39
    {
39
    {
40
        return $this->identifiant;    
40
        return $this->identifiant;
41
    }
41
    }
42
    
42
    
43
    function recupererErreur()
43
    function recupererErreur()
44
    {
44
    {
45
        return $this->erreur;
45
        return $this->erreur;
46
    }
46
    }
47
 
47
 
48
    
48
    
49
    function afficher()
49
    function afficher()
50
    {
50
    {
51
        echo "<LI><B>$this->identifiant</B></LI>";
51
        echo "<LI><B>$this->identifiant</B></LI>";
52
        for($i=0;$i<count($this->collection);$i++)
52
        for($i=0;$i<count($this->collection);$i++)
53
        {
53
        {
54
            $uneCollection =$this->collection[$i];
54
            $uneCollection =$this->collection[$i];
55
            $uneCollection->afficher();
55
            $uneCollection->afficher();
56
            
56
            
57
        }
57
        }
58
    }
58
    }
59
 
59
 
60
}
60
}
61
 
61
 
62
?>
62
?>