@@ -3,8 +3,8 @@ by_reference
3
3
4
4
**type**: ``Boolean`` **default**: ``true``
5
5
6
- In most cases, if you have a ``name`` field, then you expect ``setName``
7
- to be called on the underlying object. In some cases, however, ``setName``
6
+ In most cases, if you have a ``name`` field, then you expect ``setName() ``
7
+ to be called on the underlying object. In some cases, however, ``setName() ``
8
8
may *not* be called. Setting ``by_reference`` ensures that the setter is
9
9
called in all cases.
10
10
@@ -20,13 +20,13 @@ To explain this further, here's a simple example::
20
20
)
21
21
22
22
If ``by_reference`` is true, the following takes place behind the scenes
23
- when you call ``submit`` (or ``handleRequest``) on the form::
23
+ when you call ``submit() `` (or ``handleRequest() ``) on the form::
24
24
25
25
$article->setTitle('...');
26
26
$article->getAuthor()->setName('...');
27
27
$article->getAuthor()->setEmail('...');
28
28
29
- Notice that ``setAuthor`` is not called. The author is modified by reference.
29
+ Notice that ``setAuthor() `` is not called. The author is modified by reference.
30
30
31
31
If you set ``by_reference`` to false, submitting looks like this::
32
32
@@ -42,4 +42,4 @@ call the setter on the parent object.
42
42
Similarly, if you're using the :doc:`collection</reference/forms/types/collection>`
43
43
form type where your underlying collection data is an object (like with Doctrine's
44
44
``ArrayCollection``), then ``by_reference`` must be set to ``false`` if you
45
- need the setter (e.g. ``setAuthors``) to be called.
45
+ need the setter (e.g. ``setAuthors() ``) to be called.
0 commit comments