You are here

protected function SyncNormalizerDecoratorTrait::decorateNormalization in Content Synchronization 3.0.x

Same name and namespace in other branches
  1. 8.2 src/Plugin/SyncNormalizerDecoratorTrait.php \Drupal\content_sync\Plugin\SyncNormalizerDecoratorTrait::decorateNormalization()
1 call to SyncNormalizerDecoratorTrait::decorateNormalization()
ContentEntityNormalizer::normalize in src/Normalizer/ContentEntityNormalizer.php

File

src/Plugin/SyncNormalizerDecoratorTrait.php, line 9

Class

SyncNormalizerDecoratorTrait

Namespace

Drupal\content_sync\Plugin

Code

protected function decorateNormalization(array &$normalized_entity, ContentEntityInterface $entity, $format, array $context = []) {
  $plugins = $this
    ->getDecoratorManager()
    ->getDefinitions();
  foreach ($plugins as $decorator) {

    /* @var $instance SyncNormalizerDecoratorInterface */
    $instance = $this
      ->getDecoratorManager()
      ->createInstance($decorator['id']);
    $instance
      ->decorateNormalization($normalized_entity, $entity, $format, $context);
  }
}