Closed ghost closed 12 years ago
I understand the issue however this is by design. It is not possible to remove the check because then all calls to optional handlers will fail.
If you need to have this functionality find:
if (!method_exists($this->__info["model"],$method)) return null;
in OODBBean.php and
replace it with:
if (!method_exists($this->__info["model"],$method)) {
if (!method_exists($this->__info["model"],'magicCall')) { ... call method ... } else return null;
}
Thanks for that snippet :) This is perfect for my needs. Would you be able to push that feature to master?
No sorry, I wont be implementing this is in the master. I think this will cause RedBeanPHP to contain too much magic. There is already a great deal of magic inside, so I would like not to add some more.
One of my models looks like this, (it has been stripped down for testing):
Due to
method_exists
being used online 356
inRedBean_OODBBean.php
,__call()
in a model is never called. Would it be possible to remove this check so that all function calls are passed to the model regardless whether they exist or not?