Skip to content

Commit 37fac9f

Browse files
committed
Merge branch '7.4' into 8.0
* 7.4: [JsonStreamer] Mention how to get the current object in value transformers
2 parents 5310047 + 316e8c8 commit 37fac9f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

serializer/streaming_json.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,16 @@ When callables are not enough, you can use a service implementing the
536536
The ``getStreamValueType()`` method must return the value's type as it will
537537
appear in the JSON stream.
538538

539+
.. tip::
540+
541+
The ``$options`` argument of the ``transform()`` method includes a special
542+
option called ``_current_object`` which gives access to the object holding
543+
the current property (or ``null`` if there's none).
544+
545+
.. versionadded:: 7.4
546+
547+
The ``_current_object`` option was introduced in Symfony 7.4.
548+
539549
To use this transformer in a class, configure the ``#[ValueTransformer]`` attribute::
540550

541551
// src/Dto/Dog.php

0 commit comments

Comments
 (0)