You are here

protected function ContentEntityStorageTrait::doPostSave in Multiversion 8

Same name and namespace in other branches
  1. 8.2 src/Entity/Storage/ContentEntityStorageTrait.php \Drupal\multiversion\Entity\Storage\ContentEntityStorageTrait::doPostSave()

File

src/Entity/Storage/ContentEntityStorageTrait.php, line 302

Class

ContentEntityStorageTrait

Namespace

Drupal\multiversion\Entity\Storage

Code

protected function doPostSave(EntityInterface $entity, $update) {
  parent::doPostSave($entity, $update);

  // Set the originalId to allow entity renaming.
  $entity->originalId = $entity
    ->id();

  // Delete path alias value if there is one.
  if ($entity->_deleted->value == TRUE && isset($entity->path) && $entity->path instanceof PathFieldItemList) {
    $entity->path
      ->delete();
  }
}