In my model, I'm including the function validation(). It doesn't seem to be getting hit. I have something similar to this:
class People extends Phalcon\Mvc\Model {
public function validation() {
die('here');
}
}
$person = new People();
$person->name = 'Bob';
$person->save();
But the validation function never gets called. Is there something I'm missing?
Thanks!
This method works only for existing model records.
If you want to validate on create, you could use beforeValidationOnCreate() method.
You can visit phalcon Documentation for all events.