/** * {@inheritdoc} */ protected function invokeHook($hook, EntityInterface $entity) { parent::invokeHook($hook, $entity); $event_class = $this->entityType->getHandlerClass('event'); if ($event_class) { $this->eventDispatcher->dispatch($this->getEventName($hook), new $event_class($entity)); } }