You are here

protected function RegistrationStorage::invokeHook in RNG - Events and Registrations 8.2

Same name and namespace in other branches
  1. 3.x src/RegistrationStorage.php \Drupal\rng\RegistrationStorage::invokeHook()

Invokes a hook on behalf of the entity.

Parameters

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

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

Overrides ContentEntityStorageBase::invokeHook

File

src/RegistrationStorage.php, line 45

Class

RegistrationStorage
Defines the registration storage.

Namespace

Drupal\rng

Code

protected function invokeHook($hook, EntityInterface $entity) {
  parent::invokeHook($hook, $entity);
  $this->eventDispatcher
    ->dispatch($this
    ->getEventName($hook), new RegistrationEvent($entity));
}