We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

How to set to null when validation failure?

I want to save user data from a csv entries to mysql. Some field are invalid according to User model validators. I need to simply ignor invalid data (set them null). However, the model does does not allow that. Is there any config or workarouind?



10.9k

Try,


        public function initialize() {
           $this->setup(['notNullValidations'=>false]);
        }