Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / web / core / modules / serialization / src / Normalizer / CacheableNormalizerInterface.php
diff --git a/web/core/modules/serialization/src/Normalizer/CacheableNormalizerInterface.php b/web/core/modules/serialization/src/Normalizer/CacheableNormalizerInterface.php
new file mode 100644 (file)
index 0000000..fdd6b17
--- /dev/null
@@ -0,0 +1,23 @@
+<?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';
+
+}