You are here

function registration_user_cancel in Entity Registration 8

Same name and namespace in other branches
  1. 8.2 registration.module \registration_user_cancel()
  2. 7.2 registration.module \registration_user_cancel()
  3. 7 registration.module \registration_user_cancel()

Implements hook_user_cancel().

File

./registration.module, line 389

Code

function registration_user_cancel($edit, $account, $method) {
  if (isset($account->uid)) {
    if ($method == 'user_cancel_reassign') {
      db_update('registration')
        ->fields(array(
        'author_uid' => 0,
      ))
        ->condition('author_uid', $account->uid)
        ->execute();
      db_update('registration')
        ->fields(array(
        'user_uid' => NULL,
      ))
        ->condition('user_uid', $account->uid)
        ->execute();
    }
  }
}