DDC-3226: Unable to escape field names in YAML notation #4013

Closed
doctrinebot opened this Issue Jul 24, 2014 · 3 comments

3 participants

@doctrinebot

Jira issue originally created by user kix:

As in DDC-1759, I wanted to use some reserved words as my field names (same case: MySQL-backed key-value storage).
DDC-1759 was resolved by escaping the column names in field annotations. However, I'm using YAML files to store my mappings, and I couldn't find a way to set up an escaped field name there.

@doctrinebot

Comment created by @ocramius:

Escaping fields is done via the backtick symbol ``` in column mappings. This is not driver-specific, but applies to all mappings.

@doctrinebot

Issue was closed with resolution "Invalid"

@Ocramius Ocramius was assigned by doctrinebot Dec 6, 2015
@doctrinebot doctrinebot closed this Dec 6, 2015
@doctrinebot doctrinebot added the Bug label Dec 7, 2015
@alcalyn
alcalyn commented Apr 17, 2016 edited

I got this error, and the first result I found on google was this thread. A working example under YAML to make a reserved word as column name:

Model\Entity:
    type: entity
    table: core_entity
    fields:
        order:
            type: smallint
            column: `order`

The last line did the trick (order being a reserved word in MySQL)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment