hook_entity_load(array $entities,$entity_type_id)
Act on entities when loaded.
This is a generic load hook called for all entity types loaded via the entity API.
hook_entity_storage_load() should be used to load additional data for content entities.
\Drupal\Core\Entity\EntityInterface[] $entities: The entities keyed by entity ID.
string $entity_type_id: The type of entities being loaded (i.e. node, user, comment).
function hook_entity_load(array $entities, $entity_type_id) { foreach ($entities as $entity) { $entity->foo = mymodule_add_something($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_load/8.1.x