function EntityStorageBase::restore

Same name in other branches
  1. 8.9.x core/lib/Drupal/Core/Entity/EntityStorageBase.php \Drupal\Core\Entity\EntityStorageBase::restore()
  2. 10 core/lib/Drupal/Core/Entity/EntityStorageBase.php \Drupal\Core\Entity\EntityStorageBase::restore()
  3. 11.x core/lib/Drupal/Core/Entity/EntityStorageBase.php \Drupal\Core\Entity\EntityStorageBase::restore()

Overrides EntityStorageInterface::restore

1 method overrides EntityStorageBase::restore()
SqlContentEntityStorage::restore in core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php
Restores a previously saved entity.

File

core/lib/Drupal/Core/Entity/EntityStorageBase.php, line 611

Class

EntityStorageBase
A base entity storage class.

Namespace

Drupal\Core\Entity

Code

public function restore(EntityInterface $entity) {
    // The restore process does not invoke any pre or post-save operations.
    $this->doSave($entity->id(), $entity);
}

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