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

Breadcrumb

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

function AbstractNormalizerContextBuilder::withCallbacks

Configures an hashmap of field name => callable to normalize this field.

The callable is called if the field is encountered with the arguments:

  • 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

Parameters

array<string, callable>|null $callbacks:

File

vendor/symfony/serializer/Context/Normalizer/AbstractNormalizerContextBuilder.php, line 145

Class

AbstractNormalizerContextBuilder
A helper providing autocompletion for available AbstractNormalizer options.

Namespace

Symfony\Component\Serializer\Context\Normalizer

Code

public function withCallbacks(?array $callbacks) : static {
    return $this->with(AbstractNormalizer::CALLBACKS, $callbacks);
}

API Navigation

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