Search code examples
symfonydoctrinesymfony-2.3

(Symfony 2.3) Doctrine Mapping column names


Is it possible to map column names using a .yml file with Symfony 2.3?

The annotation method works, but not using YAML files.

Here's what I'm doing:

    dateCreated:
        type: string
        name: date_created
        length: '100'

the line name: date_created doesn't affect anything. The same with single/double quotes.

Am I missing something trivial here, or is it just not supported yet?

Thank you.


Solution

  • Try column: insted of name:

    dateCreated:
        type: string
        column: date_created
        length: 100
    

    http://docs.doctrine-project.org/en/2.0.x/reference/basic-mapping.html