function HistoryHooks::userCancel

Implements hook_user_cancel().

Attributes

File

core/modules/history/src/Hook/HistoryHooks.php, line 95

Class

HistoryHooks
Hook implementations for history.

Namespace

Drupal\history\Hook

Code

public function userCancel($edit, UserInterface $account, $method) : void {
  switch ($method) {
    case 'user_cancel_reassign':
      \Drupal::database()->delete('history')
        ->condition('uid', $account->id())
        ->execute();
      break;

  }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.