I have a series of simple classes, with a hierarcical structure.
The first (TCell) encapsulates a couple of simple variables, and has a method called toString (a-la-java).
The second (TRow) encapsulates a couple simple vars and an array (called cell) of TCell Objects.
It also has a toString method.
My problem is that I want to call the TCell's toString method inside the TRow's toString method and iterate over the array of TCells.
like:
$out;
foreach(list($k, $v) = each($this->cell))
{
$out .= $this->cell[$k]->toString();
^ ^
|-------------------------|
this is the problem,
}
Thanks