You are here

protected function IdsCleaner::cleanIds in Content Synchronization 3.0.x

Same name and namespace in other branches
  1. 8.2 src/Plugin/SyncNormalizerDecorator/IdsCleaner.php \Drupal\content_sync\Plugin\SyncNormalizerDecorator\IdsCleaner::cleanIds()

Parameters

$normalized_entity:

\Drupal\Core\Entity\ContentEntityInterface $entity:

Return value

mixed

1 call to IdsCleaner::cleanIds()
IdsCleaner::decorateNormalization in src/Plugin/SyncNormalizerDecorator/IdsCleaner.php

File

src/Plugin/SyncNormalizerDecorator/IdsCleaner.php, line 78

Class

IdsCleaner
Provides a decorator for setting the alias to entity.

Namespace

Drupal\content_sync\Plugin\SyncNormalizerDecorator

Code

protected function cleanIds(&$normalized_entity, ContentEntityInterface $entity) {
  $keys = $entity
    ->getEntityType()
    ->getKeys();
  if (isset($normalized_entity[$keys['id']])) {
    unset($normalized_entity[$keys['id']]);
  }
  if (isset($keys['revision']) && isset($normalized_entity[$keys['revision']])) {
    unset($normalized_entity[$keys['revision']]);
  }
  return $normalized_entity;
}