Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. AbstractObjectNormalizerContextBuilder.php

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\Normalizer

Code

public function withMaxDepthHandler(?callable $maxDepthHandler) : static {
    return $this->with(AbstractObjectNormalizer::MAX_DEPTH_HANDLER, $maxDepthHandler);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal