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

This commit is contained in:
nobohan 2018-04-04 17:53:11 +02:00
parent be6d3493ed
commit b004c65ec1
2 changed files with 55 additions and 53 deletions

View File

@ -50,9 +50,10 @@ class GenderFilter implements FilterInterface,
{
$builder->add('accepted_genders', ChoiceType::class, array(
'choices' => array(
Person::FEMALE_GENDER => 'Woman',
Person::MALE_GENDER => 'Man'
'Woman' => Person::FEMALE_GENDER,
'Man' => Person::MALE_GENDER
),
'choices_as_values' => true,
'multiple' => false,
'expanded' => false
));

View File

@ -305,6 +305,7 @@ class PersonSearch extends AbstractSearch implements ContainerAwareInterface,
'Man' => Person::MALE_GENDER,
'Woman' => Person::FEMALE_GENDER
],
'choices_as_values' => true,
'label' => 'Gender',
'required' => false
])