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 change a global ORM setting to allow unexpected columns?

They tell me my problem is solved as follows

This is fixed in the 2.0.x branch (Phalcon 2.0.4), you have to change a global ORM setting to allow unexpected columns:

\Phalcon\Mvc\Model::setup(['ignoreUnknownColumns' => true]);

I would like to know how to make that change



11.6k

try in the initialize method of your models, using self::setup() or maybe a magic setter exist for that, a this time the API of models don't list such a thing in the doc...

I don't understand a quesion, you can just add this code anywhere, it's using globals so it will work pretty much anywhere.



77.7k
Accepted
answer
edited May '16

Either do as @Jurigag suggested, or put this line into your relevant php.ini file:

phalcon.orm.ignore_unknown_columns = 1