How to map a single char column in Doctrine 2

annotations, char, doctrine-orm, mapping, orm

Solution

You can always use the string type with the fixed option:

/**
 * @Column(type="string", length=2, options={"fixed" = true})
 */
protected $country;

The above code snippet produces the following SQL:

`country` char(2) NOT NULL,

Problem

How can I map a single char column in Doctrine 2, using annotations? I would like to have a char type, instead a single char string.

Original source