Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork5.2k
[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
Uh oh!
There was an error while loading.Please reload this page.
Changes from1 commit
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
- Loading branch information
Uh oh!
There was an error while loading.Please reload this page.
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
pskt marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
in the configuration using :ref:`circular_reference_handler <reference-serializer-circular_reference_handler>` option. | ||
pskt marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
The service has to implement magic ``__invoke($object)`` method, like in example:: | ||
pskt marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
class MyCircularReferenceHandler | ||
{ | ||
public function __invoke($object) | ||
{ | ||
return $object->getName(); | ||
} | ||
} | ||
Going Further with the Serializer | ||
--------------------------------- | ||