function Serializer::setFallbackNormalizer

Same name in other branches
  1. 9 core/modules/jsonapi/src/Serializer/Serializer.php \Drupal\jsonapi\Serializer\Serializer::setFallbackNormalizer()
  2. 8.9.x core/modules/jsonapi/src/Serializer/Serializer.php \Drupal\jsonapi\Serializer\Serializer::setFallbackNormalizer()
  3. 11.x core/modules/jsonapi/src/Serializer/Serializer.php \Drupal\jsonapi\Serializer\Serializer::setFallbackNormalizer()

Adds a secondary normalizer.

This normalizer will be attempted when JSON:API has no applicable normalizer.

Parameters

\Symfony\Component\Serializer\Normalizer\NormalizerInterface $normalizer: The secondary normalizer.

File

core/modules/jsonapi/src/Serializer/Serializer.php, line 53

Class

Serializer
Overrides the Symfony serializer to cordon off our incompatible normalizers.

Namespace

Drupal\jsonapi\Serializer

Code

public function setFallbackNormalizer(NormalizerInterface $normalizer) {
    $this->fallbackNormalizer = $normalizer;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.