I dont know how to explain this question so maybe the tile is not matched.
Class a {
function b{
return $this;
}
function c{
return $this;
}
}
If I have class structure like this I can do
$a = new a();
$a->b()->c();
I want to know how can I know the function is not continued like $a->b();, then I return $retuslt instead of $this.
Class a {
function b{
//if not continued
return $result;
//if continued
return $this;
}
function c{
return $this;
}
}
Is this possible? thank you very much!!