You are here

public function EntityStorageBase::load in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Core/Entity/EntityStorageBase.php \Drupal\Core\Entity\EntityStorageBase::load()

Loads one entity.

Parameters

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

Return value

\Drupal\Core\Entity\EntityInterface|null An entity object. NULL if no matching entity is found.

Overrides EntityStorageInterface::load

5 calls to EntityStorageBase::load()
ConfigEntityStorage::importDelete in core/lib/Drupal/Core/Config/Entity/ConfigEntityStorage.php
Delete entities upon synchronizing configuration changes.
ConfigEntityStorage::importUpdate in core/lib/Drupal/Core/Config/Entity/ConfigEntityStorage.php
Updates entities upon synchronizing configuration changes.
EntityStorageBase::loadUnchanged in core/lib/Drupal/Core/Entity/EntityStorageBase.php
Loads an unchanged entity from the database.
ShortcutSetStorage::getDefaultSet in core/modules/shortcut/src/ShortcutSetStorage.php
Gets the default shortcut set for a given user account.
TermStorage::loadAllParents in core/modules/taxonomy/src/TermStorage.php
Finds all ancestors of a given term ID.
2 methods override EntityStorageBase::load()
ContentEntityNullStorage::load in core/lib/Drupal/Core/Entity/ContentEntityNullStorage.php
Loads one entity.
EntityTestNoLoadStorage::load in core/modules/system/tests/modules/entity_test/src/EntityTestNoLoadStorage.php
Loads one entity.

File

core/lib/Drupal/Core/Entity/EntityStorageBase.php, line 216
Contains \Drupal\Core\Entity\EntityStorageBase.

Class

EntityStorageBase
A base entity storage class.

Namespace

Drupal\Core\Entity

Code

public function load($id) {
  $entities = $this
    ->loadMultiple(array(
    $id,
  ));
  return isset($entities[$id]) ? $entities[$id] : NULL;
}