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

Column map and Unknown column

Model:

    public function columnMap()
    {
        return [
            'date_created'  => 'dateCreated',
            'date_modified' => 'dateModified'
        ];
    }

Controller:


$user = User::findFirst(1);

And...

Column not found: 1054 Unknown column 'User_Users.dateCreated' in 'field list'

I'm using Files for tables metadata. I delete all metadata cache.

edited Jan '19

The array keys are the name as they appear in the DB definition.

The array values are the object property names to which they are remapped.

I know it

The array keys are the name as they appear in the DB definition.

The array values are the object property names to which they are remapped.



589
Accepted
answer

I found answer. Thank you everyone!