Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

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 8d ago

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.



119
Accepted
answer

I found answer. Thank you everyone!