@@ -746,8 +746,12 @@ If you are using isser methods (methods prefixed by ``is``, like
746
746
``App\Model\Person::isSportsperson() ``), the Serializer component will
747
747
automatically detect and use it to serialize related attributes.
748
748
749
- The ``ObjectNormalizer `` also takes care of methods starting with ``has ``, ``add ``
750
- and ``remove ``.
749
+ The ``ObjectNormalizer `` also takes care of methods starting with ``has ``, ``can ``,
750
+ ``add `` and ``remove ``.
751
+
752
+ .. versionadded :: 6.1
753
+
754
+ The support of canners (methods prefixed by ``can ``) was introduced in Symfony 6.1.
751
755
752
756
Using Callbacks to Serialize Properties with Object Instances
753
757
-------------------------------------------------------------
@@ -811,12 +815,12 @@ The Serializer component provides several built-in normalizers:
811
815
:class: `Symfony\\ Component\\ Serializer\\ Normalizer\\ ObjectNormalizer `
812
816
This normalizer leverages the :doc: `PropertyAccess Component </components/property_access >`
813
817
to read and write in the object. It means that it can access to properties
814
- directly and through getters, setters, hassers, issers, adders and removers. It supports
815
- calling the constructor during the denormalization process.
818
+ directly and through getters, setters, hassers, issers, canners, adders and removers.
819
+ It supports calling the constructor during the denormalization process.
816
820
817
821
Objects are normalized to a map of property names and values (names are
818
- generated by removing the ``get ``, ``set ``, ``has ``, ``is ``, ``add `` or ``remove `` prefix from
819
- the method name and transforming the first letter to lowercase; e.g.
822
+ generated by removing the ``get ``, ``set ``, ``has ``, ``is ``, ``can ``, `` add `` or ``remove ``
823
+ prefix from the method name and transforming the first letter to lowercase; e.g.
820
824
``getFirstName() `` -> ``firstName ``).
821
825
822
826
The ``ObjectNormalizer `` is the most powerful normalizer. It is configured by
0 commit comments