Version 1
[yaffs-website] / web / core / modules / serialization / src / Normalizer / ConfigEntityNormalizer.php
diff --git a/web/core/modules/serialization/src/Normalizer/ConfigEntityNormalizer.php b/web/core/modules/serialization/src/Normalizer/ConfigEntityNormalizer.php
new file mode 100644 (file)
index 0000000..344bcc3
--- /dev/null
@@ -0,0 +1,24 @@
+<?php
+
+namespace Drupal\serialization\Normalizer;
+
+/**
+ * Normalizes/denormalizes Drupal config entity objects into an array structure.
+ */
+class ConfigEntityNormalizer extends EntityNormalizer {
+
+  /**
+   * The interface or class that this Normalizer supports.
+   *
+   * @var array
+   */
+  protected $supportedInterfaceOrClass = ['Drupal\Core\Config\Entity\ConfigEntityInterface'];
+
+  /**
+   * {@inheritdoc}
+   */
+  public function normalize($object, $format = NULL, array $context = []) {
+    return $object->toArray();
+  }
+
+}