function ContentEntityStorageBase::doPostSave

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php \Drupal\Core\Entity\ContentEntityStorageBase::doPostSave()
  2. 8.9.x core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php \Drupal\Core\Entity\ContentEntityStorageBase::doPostSave()
  3. 10 core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php \Drupal\Core\Entity\ContentEntityStorageBase::doPostSave()

Overrides EntityStorageBase::doPostSave

File

core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php, line 774

Class

ContentEntityStorageBase
Base class for content entity storage handlers.

Namespace

Drupal\Core\Entity

Code

protected function doPostSave(EntityInterface $entity, $update) {
    
    /** @var \Drupal\Core\Entity\ContentEntityInterface $entity */
    if ($update && $this->entityType
        ->isTranslatable()) {
        $this->invokeTranslationHooks($entity);
    }
    parent::doPostSave($entity, $update);
    // The revision is stored, it should no longer be marked as new now.
    if ($this->entityType
        ->isRevisionable()) {
        $entity->updateLoadedRevisionId();
        $entity->setNewRevision(FALSE);
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.