Skip to content

Commit 6147bbd

Browse files
Updated the last help note
1 parent a62876f commit 6147bbd

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/AppBundle/Form/Type/TagsInputType.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ public function __construct(ObjectManager $manager)
4444
public function buildForm(FormBuilderInterface $builder, array $options)
4545
{
4646
$builder
47-
// We need to transform the tags collection into a comma separated string format
48-
// so we are reusing an existing one to simplify the code, but you could build
49-
// only one to do all transformation (i.e. Collection <-> string).
50-
// Transformation flow: Collection <-> array <-> string
47+
// The Tag collection must be transformed into a comma separated string.
48+
// We could create a custom transformer to do Collection <-> string in one step,
49+
// but here we're doing the transformation in two steps (Collection <-> array <-> string)
50+
// and reuse the existing CollectionToArrayTransformer.
5151
->addModelTransformer(new CollectionToArrayTransformer(), true)
5252
->addModelTransformer(new TagArrayToStringTransformer($this->manager), true)
5353
;

0 commit comments

Comments
 (0)