You are here

function user_event_dispatcher_user_cancel in Hook Event Dispatcher 8.2

Same name and namespace in other branches
  1. 3.x modules/user_event_dispatcher/user_event_dispatcher.module \user_event_dispatcher_user_cancel()

Implements hook_user_cancel().

1 call to user_event_dispatcher_user_cancel()
UserEventTest::testUserCancelEvent in modules/user_event_dispatcher/tests/src/Unit/User/UserEventTest.php
User cancel event test.

File

modules/user_event_dispatcher/user_event_dispatcher.module, line 20
User event dispatcher submodule.

Code

function user_event_dispatcher_user_cancel(array $edit, AccountInterface $account, string $method) {

  /** @var \Drupal\hook_event_dispatcher\Manager\HookEventDispatcherManagerInterface $manager */
  $manager = Drupal::service('hook_event_dispatcher.manager');
  $event = new UserCancelEvent($edit, $account, $method);
  $manager
    ->register($event);
}