function NodeHooks::userCancelReassign
Implements hook_user_cancel().
Anonymize all of the nodes for this old account.
File
-
core/
modules/ node/ src/ Hook/ NodeHooks.php, line 61
Class
- NodeHooks
- Hook implementations for the node module.
Namespace
Drupal\node\HookCode
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.