function EntityBase::setOriginal

Same name and namespace in other branches
  1. 11.x core/lib/Drupal/Core/Entity/EntityBase.php \Drupal\Core\Entity\EntityBase::setOriginal()

Sets the original unchanged entity.

This method may be used as a performance optimization when unchanged entity is already available.

Parameters

\Drupal\Core\Entity\EntityInterface|null $original: The unchanged entity.

Return value

$this

Overrides EntityInterface::setOriginal

1 call to EntityBase::setOriginal()
Media::prepareSave in core/modules/media/src/Entity/Media.php
Sets the media entity's field values from the source's metadata.

File

core/lib/Drupal/Core/Entity/EntityBase.php, line 703

Class

EntityBase
Defines a base entity class.

Namespace

Drupal\Core\Entity

Code

public function setOriginal(?EntityInterface $original) : static {
  $this->originalEntity = $original;
  return $this;
}

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