function 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

3 calls to EntityBase::setOriginal()
EntityBase::__set in core/lib/Drupal/Core/Entity/EntityBase.php
EntityBase::__unset in core/lib/Drupal/Core/Entity/EntityBase.php
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.