function AbstractObjectNormalizerContextBuilder::withMaxDepthHandler
Configures a callback to allow to set a value for an attribute when the max depth has been reached.
If no callback is given, the attribute is skipped. If a callable is given, its return value is used (even if null).
The arguments are:
- mixed $attributeValue value of this field
- object $object the whole object being normalized
- string $attributeName name of the attribute being normalized
- string $format the requested format
- array<string, mixed> $context the serialization context
File
-
vendor/
symfony/ serializer/ Context/ Normalizer/ AbstractObjectNormalizerContextBuilder.php, line 95
Class
- AbstractObjectNormalizerContextBuilder
- A helper providing autocompletion for available AbstractObjectNormalizer options.
Namespace
Symfony\Component\Serializer\Context\NormalizerCode
public function withMaxDepthHandler(?callable $maxDepthHandler) : static {
return $this->with(AbstractObjectNormalizer::MAX_DEPTH_HANDLER, $maxDepthHandler);
}