misc_pterodactyl-panel/app/Services/Subusers/SubuserDeletionService.php

36 lines
848 B
PHP
Raw Normal View History

2017-08-26 18:31:18 +00:00
<?php
namespace Pterodactyl\Services\Subusers;
2017-09-25 03:28:16 +00:00
use Pterodactyl\Models\Subuser;
2017-08-26 18:31:18 +00:00
use Pterodactyl\Contracts\Repository\SubuserRepositoryInterface;
class SubuserDeletionService
{
/**
* @var \Pterodactyl\Contracts\Repository\SubuserRepositoryInterface
*/
2017-11-03 21:52:18 +00:00
private $repository;
2017-08-26 18:31:18 +00:00
/**
* SubuserDeletionService constructor.
*
* @param \Pterodactyl\Contracts\Repository\SubuserRepositoryInterface $repository
2017-08-26 18:31:18 +00:00
*/
public function __construct(
SubuserRepositoryInterface $repository
2017-08-26 18:31:18 +00:00
) {
$this->repository = $repository;
}
/**
* Delete a subuser and their associated permissions from the Panel and Daemon.
*
* @param \Pterodactyl\Models\Subuser $subuser
2017-08-26 18:31:18 +00:00
*/
public function handle(Subuser $subuser)
2017-08-26 18:31:18 +00:00
{
$this->repository->delete($subuser->id);
2017-08-26 18:31:18 +00:00
}
}