Subversion Repositories eFlore/Archives.eflore-consultation-v2

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
27 jpm 1
<?
2
 
3
class blockdedonnees{
4
 
5
    protected $identifiant;
6
    protected $donnees;
7
    protected $collectionBlocksfils;
8
    protected $erreur;
9
 
10
   function __construct($identifiant)
11
   {
12
       $this->identifiant = $identifiant;
13
       $this->donnees = array();
14
       $this->collectionBlocksfils = array();
15
   }
16
 
17
   function affecterIdentifiant($identifiant)
18
    {
19
        $this->identifiant = $identifiant;
20
    }
21
 
22
    function affecterDonnees($donnees)
23
    {
24
        $this->donnees = $donnees;
25
    }
26
 
27
    function recupererDonnees()
28
    {
29
        return $this->donnees;
30
    }
31
 
32
    function ajouterDonnee($clef,$valeur)
33
    {
34
        $this->donnees["$clef"] = $valeur;
35
    }
36
 
37
    function recupererDonnee($clef)
38
    {
39
        return $this->donnees["$clef"];
40
    }
41
 
42
    function recupererErreur()
43
    {
44
        return $this->erreur;
45
    }
46
 
47
    function recupererBlockFils()
48
    {
49
        return $this->blocksfils;
50
    }
51
 
52
    function ajouterCollectionBlockFils($collectionBlock)
53
    {
54
        array_push($this->collectionBlocksfils,$collectionBlock);
55
    }
56
 
57
    function afficherPattern($chemin,$fonction)
58
    {
59
        if($chemin==$this->identifiant)
60
        {
61
        }
62
        else
63
        {
64
            $etape_chemin = explode('>',$chemin);
65
            if($chemin==$etape_chemin[0])
66
            {
67
                for($i=0;$i<count($this->collectionBlocksfils);$i++)
68
                {
69
                    $collection =$this->collectionBlocksfils[$i];
70
                    if ($collection->recupererIdentifiant()==$etape_chemin[1])
71
                    {
72
                        array_shift($etape_chemin);
73
                        afficherPattern(implode('>',$etape_chemin),$fonction);
74
                    }
75
                }
76
            }
77
        }
78
    }
79
 
80
    function afficher()
81
    {
82
        echo "<OL>";
83
        foreach($this->donnees as $key => $value)
84
        {
85
            echo "<li>$key:$value ";
86
        }
87
        echo "</OL>";
88
        for($i=0;$i<count($this->collectionBlocksfils);$i++)
89
        {
90
            $collection =$this->collectionBlocksfils[$i];
91
            echo "<OL>";
92
            $collection->afficher();
93
            echo "</OL>";
94
 
95
        }
96
    }
97
 
98
}
99
 
100
?>