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

colum "x" cannot be null

\Phalcon\Mvc\Model::setup(array( 'not Null Validation' => false ));

i find that code will be my hero . But on where should i use that code ? Where i put it on ?



98.9k

Just place it before any save() you want to avoid the automatic validation:

\Phalcon\Mvc\Model::setup(array('notNullValidations' => false));