You are here

public function Serializer::setFallbackNormalizer in JSON:API 8

Same name and namespace in other branches
  1. 8.2 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

src/Serializer/Serializer.php, line 37

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;
}