Same name and namespace in other branches
  1. 8.9.x core/lib/Drupal/Core/Entity/EntityStorageBase.php \Drupal\Core\Entity\EntityStorageBase::loadUnchanged()
  2. 9 core/lib/Drupal/Core/Entity/EntityStorageBase.php \Drupal\Core\Entity\EntityStorageBase::loadUnchanged()

Loads an unchanged entity from the database.

@todo Remove this method once we have a reliable way to retrieve the unchanged entity from the entity object.

Parameters

mixed $id: The ID of the entity to load.

Return value

\Drupal\Core\Entity\EntityInterface|null The unchanged entity, or NULL if the entity cannot be loaded.

Overrides EntityStorageInterface::loadUnchanged

1 call to EntityStorageBase::loadUnchanged()
EntityStorageBase::doPreSave in core/lib/Drupal/Core/Entity/EntityStorageBase.php
Performs presave entity processing.
1 method overrides EntityStorageBase::loadUnchanged()
ContentEntityStorageBase::loadUnchanged in core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php
Loads an unchanged entity from the database.

File

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

Class

EntityStorageBase
A base entity storage class.

Namespace

Drupal\Core\Entity

Code

public function loadUnchanged($id) {
  $this
    ->resetCache([
    $id,
  ]);
  return $this
    ->load($id);
}