protected function ContentEntityStorageBase::invokeStorageLoadHook

protected ContentEntityStorageBase::invokeStorageLoadHook(array &$entities)

Invokes hook_entity_storage_load().

Parameters

\Drupal\Core\Entity\ContentEntityInterface[] $entities: List of entities, keyed on the entity ID.

File

core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php, line 383

Class

ContentEntityStorageBase
Base class for content entity storage handlers.

Namespace

Drupal\Core\Entity

Code

protected function invokeStorageLoadHook(array &$entities) {
  if (!empty($entities)) {
    // Call hook_entity_storage_load().
    foreach ($this->moduleHandler()->getImplementations('entity_storage_load') as $module) {
      $function = $module . '_entity_storage_load';
      $function($entities, $this->entityTypeId);
    }
    // Call hook_TYPE_storage_load().
    foreach ($this->moduleHandler()->getImplementations($this->entityTypeId . '_storage_load') as $module) {
      $function = $module . '_' . $this->entityTypeId . '_storage_load';
      $function($entities);
    }
  }
}

© 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!ContentEntityStorageBase.php/function/ContentEntityStorageBase::invokeStorageLoadHook/8.1.x