Skip to content

Commit 56cf668

Browse files
nixillaweaverryan
authored andcommitted
Changed $task to $tag
getTags() returns collection of Tag objects therefore you want to add $tag not $task
1 parent 67bf79b commit 56cf668

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cookbook/form/form_collections.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ Next, add a ``by_reference`` option to the ``tags`` field and set it to ``false`
456456

457457
With these two changes, when the form is submitted, each new ``Tag`` object
458458
is added to the ``Task`` class by calling the ``addTag`` method. Before this
459-
change, they were added internally by the form by calling ``$task->getTags()->add($task)``.
459+
change, they were added internally by the form by calling ``$task->getTags()->add($tag)``.
460460
That was just fine, but forcing the use of the "adder" method makes handling
461461
these new ``Tag`` objects easier (especially if you're using Doctrine, which
462462
we talk about next!).

0 commit comments

Comments
 (0)