@@ -625,9 +625,9 @@ persisted entities, which dehydrate to an ``id``).
625
625
Using DTO's on a LiveProp
626
626
~~~~~~~~~~~~~~~~~~~~~~~~~
627
627
628
- .. versionadded :: 2.11
628
+ .. versionadded :: 2.12
629
629
630
- The automatic (de)hydration of DTO objects was introduced in LiveComponents 2.11 .
630
+ The automatic (de)hydration of DTO objects was introduced in LiveComponents 2.12 .
631
631
632
632
You can also use a DTO (i.e. data transfer object / any simple class) with LiveProp as long as the property has the correct type::
633
633
@@ -648,13 +648,15 @@ To work with a collection of DTOs, specify the collection type inside PHPDoc::
648
648
649
649
Here is how the (de)hydration of DTO objects works:
650
650
651
- - It finds all properties on your DTO that are readable and writable and dehydrates each one.
652
- - the PropertyAccess component is used, which means getter and setter methods are supported, in addition to public properties.
651
+ - All "properties" (public properties or fake properties via
652
+ getter/setter methods) are read & dehydrated. If a property is settable
653
+ but not gettable (or vice versa), an error will be thrown.
654
+ - The PropertyAccess component is used to get/set the value, which means
655
+ getter and setter methods are supported, in addition to public properties.
653
656
- The DTO cannot have any constructor arguments.
654
657
655
- If this solution doesn't feat your need
656
-
657
- there are two others options to make this work:
658
+ If this solution doesn't fit your need there are two others options to
659
+ make this work:
658
660
659
661
Hydrating with the Serializer
660
662
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0 commit comments