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 macroElement implements iMacroElement{
4
 
5
    protected $identifiantblockdedonnees;
6
    protected $connexion;
7
    protected $contexteRef;
8
    protected $blockdedonneesParent;
9
    protected $collectionblockdedonnees;
10
    protected $idRes;
11
 
12
   function __construct($aConn,$aParentDataBlock,$identifiant)
13
   {
14
       $this->connexion = $aConn;
15
        $this->blockdedonneesParent = $aParentDataBlock;
16
        $this->identifiantblockdedonnees = $identifiant;
17
        $this->contexteRef = $this->blockdedonneesParent->recupererDonnees();
18
   }
19
 
20
 
21
    function construire()
22
    {
23
        $sql=$this->getSQL();
24
        if(!is_NULL($sql))
25
        {
26
            $this->openCursor($sql);
27
            while ($this->fetch());
28
            $this->closeCursor();
29
        }
30
    }
31
 
32
    function contruireparrecursiviteplate()
33
    {
34
        construire();
35
 
36
        $this->$contexteRef = $this->blockdedonnees;
37
 
38
        construire();
39
    }
40
 
41
    function contruireparrecursivite()
42
    {
43
 
44
    }
45
 
46
 
47
    function openCursor($sql)
48
    {
49
        $res = mysql_query($sql,$this->connexion);
50
        if (!$res) echo mysql_errno() . ": " . mysql_error() . "\n";
51
        $this->idRes= $res;
52
        $this->collectionblockdedonnees = new collectionblockdedonnees($this->identifiantblockdedonnees);
53
        $this->blockdedonneesParent->ajouterCollectionBlockFils($this->collectionblockdedonnees);
54
    }
55
 
56
    function fetch()
57
    {
58
        $res=mysql_fetch_assoc($this->idRes);
59
        if (!$res)
60
        {}
61
        else
62
        {
63
            //$this->blockdedonnees = new blockdedonnees($this->identifiantblockdedonnees);
64
            //$this->blockdedonnees->affecterDonnees($res);
65
            $this->collectionblockdedonnees->ajouterDonnees($res);
66
 
67
        }
68
        return $res;
69
    }
70
 
71
    function closeCursor()
72
    {
73
        mysql_free_result($this->idRes);
74
    }
75
 
76
 
77
 
78
}
79
 
80
?>