I know there are other ways around this but just for the sake of simplicity I would like to know if its possible to do something like:
MyFactory::Create()->callMe();
and myFactory class:
class MyFactory {
private $obj;
public static Create() {
$this->obj = new ClassA();
return $this->obj;
}
public function __undefinedFunctionCall() {
//function does not exist within MyFactory Class but it exists
// in ClassA
$this->obj->callMe();
}
}
so basically the function callMe does not exist within MyFactory class but it exists in ClassA. Dont ask me why I cant just extend classA because the code structure is already written and its not up to me to modify it. I just need a way around it.