diff --git a/reference/configuration/framework.rst b/reference/configuration/framework.rst index b421a6c5d3a..0d2ee60692e 100644 --- a/reference/configuration/framework.rst +++ b/reference/configuration/framework.rst @@ -1952,7 +1952,7 @@ name_converter The name converter to use. The :class:`Symfony\\Component\\Serializer\\NameConverter\\CamelCaseToSnakeCaseNameConverter` -name converter can enabled by using the ``serializer.name_converter.camel_case_to_snake_case`` +name converter can be enabled by using the ``serializer.name_converter.camel_case_to_snake_case`` value. .. seealso:: diff --git a/serializer.rst b/serializer.rst index b1e64881831..182300ea5c9 100644 --- a/serializer.rst +++ b/serializer.rst @@ -276,6 +276,22 @@ value: ], ]); +Enabling Circular Reference Handler +----------------------------------- + +The use of the :ref:`circular reference handler ` service can be defined +in the configuration using the :ref:`circular_reference_handler ` option. + +A circular reference handler service has to implement the magic ``__invoke($object)`` method, like in example:: + + class MyCircularReferenceHandler + { + public function __invoke($object) + { + return $object->getName(); + } + } + Going Further with the Serializer ---------------------------------