Skip to content

[Form] Better explicit cloning with "by_reference" option #13348

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 16, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions reference/forms/types/options/by_reference.rst.inc
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ If you set ``by_reference`` to false, submitting looks like this::
$author->setEmail('...');
$article->setAuthor($author);

So, all that ``by_reference=false`` really does is force the framework to
call the setter on the parent object.
So, all that ``by_reference=false`` really does is that it clones the object,
which enforces the framework to call the setter on the parent object.

Similarly, if you're using the :doc:`CollectionType </reference/forms/types/collection>`
field where your underlying collection data is an object (like with
Expand Down