I'm using ENUM type in one of my tables but Doctrine doesn't like it so much. So I do my research and found this topic which basically talks about it. In this other doc from Doctrine project also talks about it and two possibles solutions. I'll use the first one but:
Where it's supposed this code should go?
$conn = $em->getConnection();
$conn->getDatabasePlatform()->registerDoctrineTypeMapping('enum', 'string');
How do I deal with this from Forms later when I want to display a SELECT with those values?
Regarding this doc you need to add these lines to your config:
# app/config/config.yml
doctrine:
dbal:
connections:
default:
// Other connections parameters
mapping_types:
enum: string
For the forms I'd add a helper like getPossibleEnumValues
and use this to fill the choices in the builder:
$builder->add('enumField', 'choice', array(
'choices' => $entity->getPossibleEnumValues(),
));