Originally posted by laserlight
A simple question: can a method have a method?
Also, what does the getBar() method do?
class Foo
{
var $_bar;
...
function getBar()
{
return $this->_bar;
}
}
class Bar
{
var $bazz;
...
function getBazz()
{
return $this->bazz;
}
function speak() { .... }
}
class Bazz
{
...
function sing() { .... }
}
...
$foo = new Foo();
....
$foo->setBar( $aBar );
...
$foo->getBar()->speak();
or even:
$foo->getBar()->getBazz()->sing();
usually in java, cpp you can do that 😉