Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / vendor / chi-teck / drupal-code-generator / templates / d8 / hook / user_cancel.twig
index 7ec0f7870e495ccaf801e1029150a1eaf31d506b..8ecdbd06a7339518e37e51998c8407f3056840f6 100644 (file)
@@ -1,7 +1,7 @@
 /**
  * Implements hook_user_cancel().
  */
-function {{ machine_name }}_user_cancel($edit, $account, $method) {
+function {{ machine_name }}_user_cancel($edit, UserInterface $account, $method) {
   switch ($method) {
     case 'user_cancel_block_unpublish':
       // Unpublish nodes (current revisions).
@@ -20,7 +20,7 @@ function {{ machine_name }}_user_cancel($edit, $account, $method) {
         ->execute();
       node_mass_update($nodes, ['uid' => 0], NULL, TRUE);
       // Anonymize old revisions.
-      db_update('node_field_revision')
+      \Drupal::database()->update('node_field_revision')
         ->fields(['uid' => 0])
         ->condition('uid', $account->id())
         ->execute();