File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -210,6 +210,20 @@ The serializer can also be used to update an existing object::
210210
211211This is a common need when working with an ORM.
212212
213+ The ``OBJECT_TO_POPULATE `` is only used for the top level object. If that object
214+ is the root of a tree structure, all child elements that exist in the
215+ normalized data will be re-created with new instances.
216+
217+ ..versionadded:: 4.3
218+
219+ Symfony 4.3 introduces a new option ``AbstractObjectNormalizer::DEEP_OBJECT_TO_POPULATE ``.
220+ When this flag is set to true, existing children of the root ``OBJECT_TO_POPULATE `` are
221+ updated from the normalized data, instead of the denormalizer re-creating them.
222+
223+ Note that ``DEEP_OBJECT_TO_POPULATE `` only works for single child objects,
224+ but not for arrays of objects. Those will still be replaces when present in
225+ the normalized data.
226+
213227.. _component-serializer-attributes-groups :
214228
215229Attributes Groups
You can’t perform that action at this time.
0 commit comments