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:
parent
cdcb3f6b9f
commit
ad4827d281
|
@ -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'));
|
||||
|
|
Loading…
Reference in a new issue