You are here

public function EntityStorageInterface::restore in Drupal 8

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Entity/EntityStorageInterface.php \Drupal\Core\Entity\EntityStorageInterface::restore()

Restores a previously saved entity.

Note that the entity is assumed to be in a valid state for the storage, so the restore process does not invoke any hooks, nor does it perform any pre or post-save operations.

@internal This method should never be used to perform a regular entity save. Its only use-case is to assist updating entity types when there are complex schema changes, for example, to make them revisionable. Note that overriding this method to fix data prior to restoring is a likely sign that the current data is corrupt.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: The entity to restore.

Throws

\Drupal\Core\Entity\EntityStorageException In case of failures, an exception is thrown.

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

File

core/lib/Drupal/Core/Entity/EntityStorageInterface.php, line 177

Class

EntityStorageInterface
Defines the interface for entity storage classes.

Namespace

Drupal\Core\Entity

Code

public function restore(EntityInterface $entity);