You are here

protected function ConfigEntityStorage::invokeHook in Drupal 9

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Config/Entity/ConfigEntityStorage.php \Drupal\Core\Config\Entity\ConfigEntityStorage::invokeHook()

Invokes a hook on behalf of the entity.

Parameters

$hook: One of 'presave', 'insert', 'update', 'predelete', or 'delete'.

$entity: The entity object.

Overrides EntityStorageBase::invokeHook

1 call to ConfigEntityStorage::invokeHook()
ConfigEntityStorage::_doCreateFromStorageRecord in core/lib/Drupal/Core/Config/Entity/ConfigEntityStorage.php
Helps create a configuration entity from storage values.

File

core/lib/Drupal/Core/Config/Entity/ConfigEntityStorage.php, line 334

Class

ConfigEntityStorage
Defines the storage class for configuration entities.

Namespace

Drupal\Core\Config\Entity

Code

protected function invokeHook($hook, EntityInterface $entity) {

  // Invoke the hook.
  $this->moduleHandler
    ->invokeAll($this->entityTypeId . '_' . $hook, [
    $entity,
  ]);

  // Invoke the respective entity-level hook.
  $this->moduleHandler
    ->invokeAll('entity_' . $hook, [
    $entity,
    $this->entityTypeId,
  ]);
}