Try categorie
instead of category_id
. Doctrine and SF2 Forms work with associations, not with foreign keys.
Also $this->getCategorie()
won't work. You're in the controller context.
Instead of this leave the form to guess the type based on the Question
mapping file.
/* ... */
$form = $this->createFormBuilder($question)
->add('titre', 'text')
->add('auteur', 'text')
->add('contenu', 'textarea')
->add('categorie', null)
->getForm();
/* ... */