Set option "by_reference" to false, so the underlying entity property (addXX(), removeXX()) gets changed not the collection (#424)

Removed unneccessary commented code
This commit is contained in:
Moritz Schröder 2016-06-06 12:56:58 +02:00 committed by Marc J. Schmidt
parent cdcb3f6b9f
commit ad4827d281

View file

@ -121,7 +121,6 @@ class ModelType extends AbstractType
{
if ($options['multiple']) {
$builder
# ->addEventSubscriber(new MergeDoctrineCollectionListener())
->addViewTransformer(new CollectionToArrayTransformer(), true)
;
}
@ -233,6 +232,7 @@ class ModelType extends AbstractType
'choice_name' => $choiceName,
'choice_value' => $choiceValue,
'choice_translation_domain' => false,
'by_reference' => false,
]);
$resolver->setRequired(array('class'));