You are here

path_event_dispatcher.module in Hook Event Dispatcher 3.x

Same filename and directory in other branches
  1. 8.2 modules/path_event_dispatcher/path_event_dispatcher.module

Path event dispatcher submodule.

File

modules/path_event_dispatcher/path_event_dispatcher.module
View source
<?php

/**
 * @file
 * Path event dispatcher submodule.
 */
use Drupal\path_event_dispatcher\Event\Path\PathDeleteEvent;
use Drupal\path_event_dispatcher\Event\Path\PathInsertEvent;
use Drupal\path_event_dispatcher\Event\Path\PathUpdateEvent;

/**
 * Implements hook_path_insert().
 *
 * {@inheritdoc}
 */
function path_event_dispatcher_path_insert(array $path) {

  /** @var \Drupal\hook_event_dispatcher\Manager\HookEventDispatcherManagerInterface $manager */
  $manager = Drupal::service('hook_event_dispatcher.manager');
  $event = new PathInsertEvent($path);
  $manager
    ->register($event);
}

/**
 * Implements hook_path_update().
 *
 * {@inheritdoc}
 */
function path_event_dispatcher_path_update(array $path) {

  /** @var \Drupal\hook_event_dispatcher\Manager\HookEventDispatcherManagerInterface $manager */
  $manager = Drupal::service('hook_event_dispatcher.manager');
  $event = new PathUpdateEvent($path);
  $manager
    ->register($event);
}

/**
 * Implements hook_path_delete().
 *
 * {@inheritdoc}
 */
function path_event_dispatcher_path_delete(array $path) {

  /** @var \Drupal\hook_event_dispatcher\Manager\HookEventDispatcherManagerInterface $manager */
  $manager = Drupal::service('hook_event_dispatcher.manager');
  $event = new PathDeleteEvent($path);
  $manager
    ->register($event);
}

Functions

Namesort descending Description
path_event_dispatcher_path_delete Implements hook_path_delete().
path_event_dispatcher_path_insert Implements hook_path_insert().
path_event_dispatcher_path_update Implements hook_path_update().