Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Serializer] Section about configuring Circular Reference Handler#12431

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
pskt wants to merge5 commits intosymfony:3.4
base:3.4
Choose a base branch
Loading
frompskt:serializer
Open
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletionreference/configuration/framework.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -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 canbeenabled by using the ``serializer.name_converter.camel_case_to_snake_case``
value.

.. seealso::
Expand Down
16 changes: 16 additions & 0 deletionsserializer.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -276,6 +276,22 @@ value:
],
]);

Enabling Circular Reference Handler
-----------------------------------

The use of the :ref:`circular reference handler <component-serializer-handling-circular-references>` service can be defined
in the configuration using the :ref:`circular_reference_handler <reference-serializer-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
---------------------------------

Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp