Skip to content

Commit 706119c

Browse files
committed
[book][forms] Tweaking good note about property_path
1 parent 3029b62 commit 706119c

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

book/forms.rst

+6-3
Original file line numberDiff line numberDiff line change
@@ -794,20 +794,23 @@ the choice is ultimately up to you.
794794

795795
.. tip::
796796

797-
When mapping forms to objects, all fields are mapped, any fields on the
797+
When mapping forms to objects, all fields are mapped. Any fields on the
798798
form that do not exist on the mapped object will cause an exception to
799799
be thrown.
800800

801801
In cases where you need extra fields in the form (for example: a "do you
802-
agree with these terms" checkbox) that will not be mapped to the undelying
803-
object, you need to set the property_path setting to ``false``.
802+
agree with these terms" checkbox) that will not be mapped to the underlying
803+
object, you need to set the property_path option to ``false``::
804804
805805
public function buildForm(FormBuilder $builder, array $options)
806806
{
807807
$builder->add('task');
808808
$builder->add('dueDate', null, array('property_path' => false));
809809
}
810810

811+
Additionally, if there are any fields on the form that aren't included in
812+
the submitted data, those fields will be explicitly set to ``null``.
813+
811814
.. index::
812815
pair: Forms; Doctrine
813816

0 commit comments

Comments
 (0)