W3cubDocs

/Drupal 8

function hook_ENTITY_TYPE_storage_load

hook_ENTITY_TYPE_storage_load(array $entities)

Act on content entities of a given type when loaded from the storage.

The results of this hook will be cached if the entity type supports it.

Parameters

\Drupal\Core\Entity\EntityInterface[] $entities: The entities keyed by entity ID.

See also

hook_entity_storage_load()

Related topics

Hooks
Define functions that alter the behavior of Drupal core.

File

core/lib/Drupal/Core/Entity/entity.api.php, line 877
Hooks and documentation related to entities.

Code

function hook_ENTITY_TYPE_storage_load(array $entities) {
  foreach ($entities as $entity) {
    $entity->foo = mymodule_add_something_uncached($entity);
  }
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Entity!entity.api.php/function/hook_ENTITY_TYPE_storage_load/8.1.x