I haven’t seen its source code, but it’s like this, $page->children() returns an object, and this object has the method visible(). So you can call it like this, which is also called chain call.
Give me an example
class Wallet
{
protected $money;
public function money()
{
$this->money = new Money();
return $this->money;
}
}
class Money
{
protected $total;
public function used($count)
{
$this->total -= $count;
}
}
I haven’t seen its source code, but it’s like this,
$page->children()
returns an object, and this object has the methodvisible()
. So you can call it like this, which is also called chain call.Give me an example
You can chain calls like this