Hello everyone I need a help with how validator works in phalcon model.
I have user model that contains password field and has length validation rule for the password. When I am inserting new rules and validation doesnt fail, the password is hashed in model method afterValidationOnCreate() and the hash is then inserted into db.
Now when I want to update the user row, validator always complains at the password length since the hash is longer than my max allowed length for password.
My idea was doing something like $user = User::findFirst($id); $user->setName('newusername'); $user->update();
But even though I am not updating the password field, it is still being validated and fails the update. Also phql doesnt work either as it requires models which produces same issue.
So is there a way to disable validator for single query or stop it from validating fields that havent changed? I have tried putting " $this->useDynamicUpdate(true);" into initialize method but that didnt help.