You are here

protected function SyncNormalizerDecoratorTrait::decorateDenormalization in Content Synchronization 8.2

Same name and namespace in other branches
  1. 3.0.x src/Plugin/SyncNormalizerDecoratorTrait.php \Drupal\content_sync\Plugin\SyncNormalizerDecoratorTrait::decorateDenormalization()
1 call to SyncNormalizerDecoratorTrait::decorateDenormalization()
ContentEntityNormalizer::denormalize in src/Normalizer/ContentEntityNormalizer.php
Denormalizes data back into an object of the given class.

File

src/Plugin/SyncNormalizerDecoratorTrait.php, line 18

Class

SyncNormalizerDecoratorTrait

Namespace

Drupal\content_sync\Plugin

Code

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

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