Closed antitoxic closed 12 years ago
The check being done is just to help prevent mistakes, not to limit possible usage. If we were to change to method_exists()
it would expressly disallow using __callStatic()
or __call()
while returning true
when the method actually isn't callable (private/protected). This is why it uses is_callable()
: it doesn't limit possible use cases, it only doesn't warn when using a class you shouldn't use for this - but there's only so much coding mistakes we can help prevent, and it's not worth limiting functionality.
@jschreuder Please, can Fuel at least check whether whether $method
is false
.
Otherwise it's not possible to follow the instructions at http://docs.fuelphp.com/classes/validation/validation.html and define custom model validation rules when using Model_Crud
based classes without defining empty methods.
The docs are lacking there, use $val->add_callabe('Model_Name');
and it'll be added as a source for validation rules without trying to add the fields.
Model_Crud
based classes have__callStatic
which makesadd_model()
always to return true.Maybe
method_exists
can be used?Maybe add a check whether
$method
is null and if so don't search for it?I am currently using a workaround of defining empty
set_form_fields
methods to myModel_Crud
classes.