CacheableNormalizerInterface.php

Same filename in other branches
  1. 9 core/modules/serialization/src/Normalizer/CacheableNormalizerInterface.php
  2. 8.9.x core/modules/serialization/src/Normalizer/CacheableNormalizerInterface.php
  3. 10 core/modules/serialization/src/Normalizer/CacheableNormalizerInterface.php

Namespace

Drupal\serialization\Normalizer

File

core/modules/serialization/src/Normalizer/CacheableNormalizerInterface.php

View source
<?php

namespace Drupal\serialization\Normalizer;

use Symfony\Component\Serializer\Normalizer\NormalizerInterface;

/**
 * Defines the interface for normalizers producing cacheable normalizations.
 *
 * @see cache
 */
interface CacheableNormalizerInterface extends NormalizerInterface {
    
    /**
     * Name of key for bubbling cacheability metadata via serialization context.
     *
     * @see \Symfony\Component\Serializer\Normalizer\NormalizerInterface::normalize()
     * @see \Symfony\Component\Serializer\SerializerInterface::serialize()
     * @see \Drupal\rest\EventSubscriber\ResourceResponseSubscriber::renderResponseBody()
     */
    const SERIALIZATION_CONTEXT_CACHEABILITY = 'cacheability';

}

Interfaces

Title Deprecated Summary
CacheableNormalizerInterface Defines the interface for normalizers producing cacheable normalizations.

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