You are here

function rules_user_logout in Rules 8.3

Same name and namespace in other branches
  1. 7.2 modules/events.inc \rules_user_logout()

Implements hook_user_logout().

2 calls to rules_user_logout()
EventIntegrationTest::testMultipleEvents in tests/src/Kernel/EventIntegrationTest.php
Test that rules config supports multiple events.
EventIntegrationTest::testUserLogoutEvent in tests/src/Kernel/EventIntegrationTest.php
Test that the user logout hook triggers the Rules event listener.
3 string references to 'rules_user_logout'
EventIntegrationTest::testMultipleEvents in tests/src/Kernel/EventIntegrationTest.php
Test that rules config supports multiple events.
EventIntegrationTest::testUserLogoutEvent in tests/src/Kernel/EventIntegrationTest.php
Test that the user logout hook triggers the Rules event listener.
UserLogoutTest::testUserLogoutEvent in tests/src/Unit/Integration/Event/UserLogoutTest.php
Tests the event metadata.

File

./rules.module, line 108
Hook implementations for the Rules module.

Code

function rules_user_logout($account) {

  // Set the account twice on the event: as the main subject but also in the
  // list of arguments.
  $event = new UserLogoutEvent($account, [
    'account' => $account,
  ]);
  $event_dispatcher = \Drupal::service('event_dispatcher');
  $event_dispatcher
    ->dispatch(UserLogoutEvent::EVENT_NAME, $event);
}