/** * This method deletes a user * * @param \eZ\Publish\API\Repository\Values\User\User $user * * @throws \eZ\Publish\API\Repository\Exceptions\UnauthorizedException if the authenticated user is not allowed to delete the user */ public function deleteUser(APIUser $user) { $loadedUser = $this->loadUser($user->id); $this->repository->beginTransaction(); try { $this->repository->getContentService()->deleteContent($loadedUser->getVersionInfo()->getContentInfo()); $this->userHandler->delete($loadedUser->id); $this->repository->commit(); } catch (Exception $e) { $this->repository->rollback(); throw $e; } }