By my knowledge I can only call the method of a class only if I instantiate or if the method is static!
I can only do something like class->metodo('var')
or class::metodo('var')
.
However, I've seen in some code something like class->metodo('var')->outrometodo('')
.
Drupal itself uses something similar. Ex:
db_select('node', 'n')->execute()->fetchCol();
How do you make this type of call, and what would be the advantages?