crocheteer-8.x-1.0/src/EventSubscriber/HookEntityViewEventSubscriber.php
src/EventSubscriber/HookEntityViewEventSubscriber.php
<?php
namespace Drupal\crocheteer\EventSubscriber;
use Drupal\hook_event_dispatcher\Event\Entity\EntityViewEvent;
use Drupal\hook_event_dispatcher\HookEventDispatcherInterface;
/**
* Register Hooks handler for the Entity View Event.
*
* @property-read \Drupal\crocheteer\Plugin\Hook\Entity\HookEntityViewPluginManager $pluginManager
*/
class HookEntityViewEventSubscriber extends HookEventSubscriber {
/**
* {@inheritdoc}
*/
public static function getSubscribedEvents() : array {
return [
HookEventDispatcherInterface::ENTITY_VIEW => 'onEntityView',
];
}
/**
* On Entity View Event.
*
* @param \Drupal\hook_event_dispatcher\Event\Entity\EntityViewEvent $event
* The Entity View Event.
*/
public function onEntityView(EntityViewEvent $event) : void {
$this->handleHooks($event);
}
}
