EntityStorageBase::postLoad

protected EntityStorageBase::postLoad(array &$entities)

Attaches data to entities upon loading.

Parameters

array $entities: Associative array of query results, keyed on the entity ID.

File

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

Class

EntityStorageBase
A base entity storage class.

Namespace

Drupal\Core\Entity

Code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
protected function postLoad(array &$entities) {
  $entity_class = $this->entityClass;
  $entity_class::postLoad($this, $entities);
  // Call hook_entity_load().
  foreach ($this->moduleHandler()->getImplementations('entity_load') as $module) {
    $function = $module . '_entity_load';
    $function($entities, $this->entityTypeId);
  }
  // Call hook_TYPE_load().
  foreach ($this->moduleHandler()->getImplementations($this->entityTypeId . '_load') as $module) {
    $function = $module . '_' . $this->entityTypeId . '_load';
    $function($entities);
  }
}
doc_Drupal
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.