I have a class:
class Module {
public function a(...params...) {
//do something, doesn't return anything
}
public function b(...params...) {
//do something, doesn't return anything
}
public function c(...params...) {
//do something, doesn't return anything
}
public function getAsArray() {
return get_object_vars($this);
}
}
Is it possible to modify module class, so methods a(),b() and c() return $this? I don't want to write it in every function. getAsArray() should return what it does. Module will be base for other classes and I want this mechanism to be implemented in base, but use it in inheriting classes.
I want to use it like this:
$module = new Module();
$module->a()->b()->c()->getAsArray();