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::
431
431
Mapping Collections
432
432
-------------------
433
433
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:
436
437
437
438
Example::
438
439
@@ -446,13 +447,13 @@ Example::
446
447
public array $products;
447
448
}
448
449
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 .
452
453
453
454
.. versionadded :: 7.4
454
455
455
- The MapCollection component was introduced in Symfony 7.4.
456
+ The `` MapCollection `` transformer was introduced in Symfony 7.4.
456
457
457
458
Mapping Multiple Targets
458
459
------------------------
You can’t perform that action at this time.
0 commit comments