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 @@ -478,6 +478,20 @@ Which transformer you need depends on your situation.
478478
479479To use the view transformer, call ``addViewTransformer() ``.
480480
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+
481495So why Use the Model Transformer?
482496---------------------------------
483497
You can’t perform that action at this time.
0 commit comments