W3cubDocs

/Drupal 8

protected function ConfigEntityStorage::invokeHook

protected ConfigEntityStorage::invokeHook($hook, EntityInterface $entity)

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

File

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

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, array($entity));
  // Invoke the respective entity-level hook.
  $this->moduleHandler->invokeAll('entity_' . $hook, array($entity, $this->entityTypeId));
}

© 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!Config!Entity!ConfigEntityStorage.php/function/ConfigEntityStorage::invokeHook/8.1.x