// The entity is no longer new.
$entity->
enforceIsNew(FALSE
);
// Allow code to run after saving.
$entity->
postSave($this,
$update);
$this->
invokeHook($update ? 'update' : 'insert',
$entity);
// After saving, this is now the "original entity", and subsequent saves
// will be updates instead of inserts, and updates must always be able to
// correctly identify the original entity.
$entity->
setOriginalId($entity->
id());
unset($entity->original
);
} /**
* {@inheritdoc}
*/
public function restore(EntityInterface
$entity) { // The restore process does not invoke any pre or post-save operations.
$this->
doSave($entity->
id(),
$entity);
}