Delete user from an app

I want to delete a user.
User.php has a method “public function delete()” which calls AccountsManager.php method “public function deleteUser(IUser $user)”.

How do I call the needed method from my app?

Hello @joe-user,

the $user->delete() does more than just pass the request to the AccountsManager.php. Some cleanup is done and then the user is removed. I would suggest, to use the delete() method of the user in question.

What do you mean by this? I suspect you know how the core handles the control to your controller upon invocation of a route and how to program in PHP? So, the question is a bit unspecific. Could you please elaborate a bit?