Commit 08c9054e authored by Alex Pott's avatar Alex Pott
Browse files

Issue #2181601 by damiankloip:...

Issue #2181601 by damiankloip: Drupal\serialization\Normalizer\EntityNormalizer should extend ComplexDataNormalizer.
parent 808eb743
Loading
Loading
Loading
Loading
+1 −13
Changes for core/modules/serialization/src/Normalizer/EntityNormalizer.php: 1 added line, 13 removed lines.
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@
/**
 * Normalizes/denormalizes Drupal entity objects into an array structure.
 */
class EntityNormalizer extends NormalizerBase implements DenormalizerInterface {
class EntityNormalizer extends ComplexDataNormalizer implements DenormalizerInterface {

  /**
   * The interface or class that this Normalizer supports.
@@ -40,18 +40,6 @@ public function __construct(EntityManagerInterface $entity_manager) {
    $this->entityManager = $entity_manager;
  }

  /**
     * {@inheritdoc}
     */
  public function normalize($object, $format = NULL, array $context = array()) {
    $attributes = array();
    foreach ($object as $name => $field) {
      $attributes[$name] = $this->serializer->normalize($field, $format);
    }

    return $attributes;
  }

  /**
   * {@inheritdoc}
   */