Вот код реализации данной цепочки :
<?php
class FOO
{
public function bar(){
echo "bar method is called...";
return $this;
}
public function baz(){
echo "baz method is called...";
$foo = new FOO;
$foo-> baz()-> bar();
Вот код реализации данной цепочки :
<?php
class FOO
{
public function bar(){
echo "bar method is called...";
return $this;
}
public function baz(){
echo "baz method is called...";
return $this;
}
}
$foo = new FOO;
$foo-> baz()-> bar();