Possible Duplicate:
How to build multi oop functions in PHP5
Hey,
I’ve seen this kind of code in a couple of forum systems but I can’t find any examples like this:
$this->function()->anotherfunction();
You can see a similar example in PDO:
$pdo->query($sqlQuery)->fetch();
I don’t know how this type of coding is called in PHP and thus I can’t get on looking for any tutorials and examples.
This is called method chaining. An example would be the following. Notice we are returning the current object.