function NodeHooks::userCancelReassign

Implements hook_user_cancel().

Anonymize all of the nodes for this old account.

Attributes

File

core/modules/node/src/Hook/NodeHooks.php, line 61

Class

NodeHooks
Hook implementations for the node module.

Namespace

Drupal\node\Hook

Code

public function userCancelReassign($edit, UserInterface $account, $method) : void {
  if ($method === 'user_cancel_reassign') {
    $vids = $this->nodeStorage
      ->userRevisionIds($account);
    $this->moduleHandler
      ->invoke('node', 'mass_update', [
      $vids,
      [
        'uid' => 0,
        'revision_uid' => 0,
      ],
      NULL,
      TRUE,
      TRUE,
    ]);
  }
}

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