File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -431,8 +431,9 @@ And the related target object must define the ``createFromLegacy()`` method::
431431Mapping Collections
432432-------------------
433433
434- By default, ObjectMapper does not map arrays or traversable collections.
435- To map each item in a collection (such as an array of DTOs to an array of entities), you **must ** use the `MapCollection ` transformer explicitly:
434+ By default, ObjectMapper does not map arrays or traversable collections. To map
435+ each item in a collection (for example, mapping an array of DTOs to an array of
436+ entities), you **must ** explicitly use the ``MapCollection `` transformer:
436437
437438Example::
438439
@@ -446,13 +447,13 @@ Example::
446447 public array $products;
447448 }
448449
449- This configuration tells ObjectMapper to map each item in the `products ` array using the usual mapping rules.
450-
451- If you do not add ` transform: new MapCollection() `, the array will be mapped as-is .
450+ With this configuration, ObjectMapper maps each item in the `` products `` array
451+ according to the usual mapping rules. Without `` transform: new MapCollection() ``,
452+ the array is left unchanged .
452453
453454.. versionadded :: 7.4
454455
455- The MapCollection component was introduced in Symfony 7.4.
456+ The `` MapCollection `` transformer was introduced in Symfony 7.4.
456457
457458Mapping Multiple Targets
458459------------------------
You can’t perform that action at this time.
0 commit comments