diff --git a/app/sprinkles/account/src/Database/Models/User.php b/app/sprinkles/account/src/Database/Models/User.php index 0770a8885..178ea9ff4 100644 --- a/app/sprinkles/account/src/Database/Models/User.php +++ b/app/sprinkles/account/src/Database/Models/User.php @@ -161,7 +161,7 @@ public function activities() * @param bool $hardDelete Set to true to completely remove the user and all associated objects. * @return bool true if the deletion was successful, false otherwise. */ - public function delete($hardDelete = false) + public function deleteUser($hardDelete = false) { /** @var UserFrosting\Sprinkle\Core\Util\ClassMapper $classMapper */ $classMapper = static::$ci->classMapper; @@ -180,10 +180,10 @@ public function delete($hardDelete = false) // TODO: remove any persistences // Delete the user - $result = parent::forceDelete(); + $result = $this->forceDelete(); } else { // Soft delete the user, leaving all associated records alone - $result = parent::delete(); + $result = $this->delete(); } return $result; diff --git a/app/sprinkles/admin/src/Controller/UserController.php b/app/sprinkles/admin/src/Controller/UserController.php index 22780a814..3db8caf91 100644 --- a/app/sprinkles/admin/src/Controller/UserController.php +++ b/app/sprinkles/admin/src/Controller/UserController.php @@ -279,7 +279,7 @@ public function delete($request, $response, $args) // Begin transaction - DB will be rolled back if an exception occurs Capsule::transaction( function() use ($user, $userName, $currentUser) { - $user->delete(); + $user->deleteUser(); unset($user); // Create activity record