You are here

function hook_event_dispatcher_path_insert in Hook Event Dispatcher 8

Implements hook_path_insert().

2 calls to hook_event_dispatcher_path_insert()
PathEventTest::testPathInsertEvent in tests/src/Unit/Path/PathEventTest.php
Test PathInsertEvent.
PathEventTest::testWithEmptyPath in tests/src/Unit/Path/PathEventTest.php
Test with empty path array.

File

./hook_event_dispatcher.module, line 387
Hook event dispatcher module.

Code

function hook_event_dispatcher_path_insert($path) {
  if (empty($path)) {
    return;
  }

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