Let's say I have a Class
<?php
class MyClass extends OtherClass
{
public function foo()
{
// some stuff
}
public function bar()
{
// some stuff
}
public function baz()
{
// some stuff
}
}
Now I need to add another method, that need to be called from every other method.
private function run_this()
{
$mandatary = true;
return $mandatary;
}
I can add a simple $this->run_this()
in every method, OK, but is it possible to add some "magic" recipient to invoke run_this()
from every method of this class?