File tree 1 file changed +14
-0
lines changed
1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -478,6 +478,20 @@ Which transformer you need depends on your situation.
478
478
479
479
To use the view transformer, call ``addViewTransformer() ``.
480
480
481
+ .. caution ::
482
+
483
+ Be careful with model transformers and
484
+ :doc: `Collection </reference/forms/types/collection >` field types.
485
+ Collection's children are created early at ``PRE_SET_DATA `` by its
486
+ ``ResizeFormListener `` and their data is populated later from the normalized
487
+ data. So your model transformer cannot reduce the number of items within the
488
+ Collection (i.e. filtering out some items), as in that case the collection
489
+ ends up with some empty children.
490
+
491
+ A possible workaround for that limitation could be not using the underlying
492
+ object directly, but a DTO (Data Transfer Object) instead, that implements
493
+ the transformation of such incompatible data structures.
494
+
481
495
So why Use the Model Transformer?
482
496
---------------------------------
483
497
You can’t perform that action at this time.
0 commit comments