Skip to content
Merged
Changes from all 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
10 changes: 10 additions & 0 deletions serializer/streaming_json.rst
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,16 @@ When callables are not enough, you can use a service implementing the
The ``getStreamValueType()`` method must return the value's type as it will
appear in the JSON stream.

.. tip::

The ``$options`` argument of the ``transform()`` method includes a special
option called ``_current_object`` which gives access to the object holding
the current property (or ``null`` if there's none).

.. versionadded:: 7.4

The ``_current_object`` option was introduced in Symfony 7.4.

To use this transformer in a class, configure the ``#[ValueTransformer]`` attribute::

// src/Dto/Dog.php
Expand Down