New file |
0,0 → 1,62 |
<? |
|
class collectionblockdedonnees{ |
|
protected $identifiant; |
protected $collection; |
protected $erreur; |
|
function __construct($identifiant) |
{ |
$this->identifiant = $identifiant; |
$this->collection = array(); |
} |
|
function affecterIdentifiant($identifiant) |
{ |
$this->identifiant = $identifiant; |
} |
|
function ajouterDonnees($donnees) |
{ |
$block = new blockdedonnees($this->identifiant); |
$block->affecterDonnees($donnees); |
$this->affecterBlockDeDonnees($block); |
|
} |
|
function affecterBlockDeDonnees($blockdonnees) |
{ |
array_push($this->collection,$blockdonnees); |
} |
|
function recupererBlocksDeDonnees() |
{ |
return $this->collection; |
} |
|
function recupererIdentifiant() |
{ |
return $this->identifiant; |
} |
|
function recupererErreur() |
{ |
return $this->erreur; |
} |
|
|
function afficher() |
{ |
echo "<LI><B>$this->identifiant</B></LI>"; |
for($i=0;$i<count($this->collection);$i++) |
{ |
$uneCollection =$this->collection[$i]; |
$uneCollection->afficher(); |
|
} |
} |
|
} |
|
?> |