You are here

interface ContentEntityNormalizerInterface in Default Content for D8 2.0.x

Normalizes and denormalizes content entities.

Hierarchy

Expanded class hierarchy of ContentEntityNormalizerInterface

All classes that implement ContentEntityNormalizerInterface

2 files declare their use of ContentEntityNormalizerInterface
Exporter.php in src/Exporter.php
Importer.php in src/Importer.php

File

src/Normalizer/ContentEntityNormalizerInterface.php, line 10

Namespace

Drupal\default_content\Normalizer
View source
interface ContentEntityNormalizerInterface {

  /**
   * Normalizes the entity into an array structure.
   *
   * @param \Drupal\Core\Entity\ContentEntityInterface $entity
   *   The content entity.
   *
   * @return array
   *   The normalized values, top level keys must include _meta with at
   *   least the entity_type and uuid keys, as well as the values for the
   *   default language in the default key and optionally translations.
   */
  public function normalize(ContentEntityInterface $entity);

  /**
   * Converts the normalized data back into a content entity.
   *
   * @param array $data
   *   The normalized data.
   *
   * @return \Drupal\Core\Entity\ContentEntityInterface
   *   The denormalized content entity.
   */
  public function denormalize(array $data);

}

Members

Namesort descending Modifiers Type Description Overrides
ContentEntityNormalizerInterface::denormalize public function Converts the normalized data back into a content entity. 1
ContentEntityNormalizerInterface::normalize public function Normalizes the entity into an array structure. 1