if ($translator) { $message =
$translator->
trans($messageTemplate,
['{{ value }}' =>
$clientDataAsString], 'validators'
);
} else { $message =
strtr($messageTemplate,
['{{ value }}' =>
$clientDataAsString]);
} $form->
addError(new FormError($message,
$messageTemplate,
['{{ value }}' =>
$clientDataAsString], null,
new TransformationFailedException(sprintf('The choices "%s" do not exist in the choice list.',
$clientDataAsString))));
} });
// <select> tag with "multiple" option or list of checkbox inputs
$builder->
addViewTransformer(new ChoicesToValuesTransformer($choiceList));
} else { // <select> tag without "multiple" option or list of radio inputs
$builder->
addViewTransformer(new ChoiceToValueTransformer($choiceList));
} if ($options['multiple'
] &&
$options['by_reference'
]) { // Make sure the collection created during the client->norm
// transformation is merged back into the original collection
$builder->
addEventSubscriber(new MergeCollectionListener(true, true
));
}