EntityStorageBase::invokeHook

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

Invokes a hook on behalf of the entity.

Parameters

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

\Drupal\Core\Entity\EntityInterface $entity: The entity object.

File

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

Class

EntityStorageBase
A base entity storage class.

Namespace

Drupal\Core\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));
}
doc_Drupal
2016-10-29 09:07:40
Comments
Leave a Comment

Please login to continue.