fix deprecations: use choices_as_values=true and flip content of the choice options

This commit is contained in:
nobohan
2018-04-04 17:50:23 +02:00
parent 9951a5d765
commit 23dd4ec48b
6 changed files with 23 additions and 15 deletions

View File

@@ -47,7 +47,8 @@ class CustomFieldsGroupType extends AbstractType
$builder
->add('name', 'translatable_string')
->add('entity', ChoiceType::class, array(
'choices' => $entities
'choices' => array_combine(array_values($entities),array_keys($entities)),
'choices_as_values' => true
))
;