Rev 27 | Blame | Last modification | View Log | RSS feed
<?php
class macroElement implements iMacroElement{
protected $identifiantblockdedonnees;
protected $connexion;
protected $contexteRef;
protected $blockdedonneesParent;
protected $collectionblockdedonnees;
protected $idRes;
function __construct($aConn,$aParentDataBlock,$identifiant)
{
$this->connexion = $aConn;
$this->blockdedonneesParent = $aParentDataBlock;
$this->identifiantblockdedonnees = $identifiant;
$this->contexteRef = $this->blockdedonneesParent->recupererDonnees();
}
function construire()
{
$sql=$this->getSQL();
if(!is_NULL($sql)) {
$this->openCursor($sql);
while ($this->fetch());
$this->closeCursor();
}
}
function contruireparrecursiviteplate()
{
construire();
$this->$contexteRef = $this->blockdedonnees;
construire();
}
function contruireparrecursivite()
{
}
function openCursor($sql)
{
$res = mysql_query($sql, $this->connexion);
if (!$res) echo mysql_errno().': '.mysql_error()."\n";
$this->idRes = $res;
$this->collectionblockdedonnees = new collectionblockdedonnees($this->identifiantblockdedonnees);
$this->blockdedonneesParent->ajouterCollectionBlockFils($this->collectionblockdedonnees);
}
function fetch()
{
$res=mysql_fetch_assoc($this->idRes);
if (!$res) {
} else {
//$this->blockdedonnees = new blockdedonnees($this->identifiantblockdedonnees);
//$this->blockdedonnees->affecterDonnees($res);
$this->collectionblockdedonnees->ajouterDonnees($res);
}
return $res;
}
function closeCursor()
{
mysql_free_result($this->idRes);
}
}
?>