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

Closed
pskt wants to merge5 commits intosymfony:3.4frompskt:serializer
Closed
Changes from1 commit
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
NextNext commit
Add section about Circular Reference Handler
  • Loading branch information
@pskt
pskt committedOct 5, 2019
commitc5d01f75736f35720b4a41e576a7805180c3789b
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 :ref:`circular reference handler <component-serializer-handling-circular-references>` service can be defined
in the configuration using :ref:`circular_reference_handler <reference-serializer-circular_reference_handler>` option.

The service has to implement 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