Method calling method [duplicate]

2

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?

    
asked by anonymous 10.11.2017 / 03:09

0 answers