2016-11-26 19:29:57 -05:00
|
|
|
<?php
|
2016-12-07 22:46:38 +00:00
|
|
|
|
2017-08-23 21:34:11 -05:00
|
|
|
namespace Pterodactyl\Contracts\Repository;
|
2016-11-26 19:29:57 -05:00
|
|
|
|
2017-10-27 21:42:53 -05:00
|
|
|
use Pterodactyl\Models\Subuser;
|
|
|
|
|
2017-08-23 21:34:11 -05:00
|
|
|
interface SubuserRepositoryInterface extends RepositoryInterface
|
2016-11-26 19:29:57 -05:00
|
|
|
{
|
2017-08-26 18:08:11 -05:00
|
|
|
/**
|
|
|
|
* Return a subuser with the associated server relationship.
|
|
|
|
*
|
2017-10-27 21:42:53 -05:00
|
|
|
* @param \Pterodactyl\Models\Subuser $subuser
|
|
|
|
* @param bool $refresh
|
2017-09-24 21:12:30 -05:00
|
|
|
* @return \Pterodactyl\Models\Subuser
|
2017-08-26 18:08:11 -05:00
|
|
|
*/
|
2017-11-05 12:38:39 -06:00
|
|
|
public function loadServerAndUserRelations(Subuser $subuser, bool $refresh = false): Subuser;
|
2017-08-26 18:08:11 -05:00
|
|
|
|
2017-09-04 18:12:13 -05:00
|
|
|
/**
|
|
|
|
* Return a subuser with the associated permissions relationship.
|
|
|
|
*
|
2017-10-27 21:42:53 -05:00
|
|
|
* @param \Pterodactyl\Models\Subuser $subuser
|
|
|
|
* @param bool $refresh
|
|
|
|
* @return \Pterodactyl\Models\Subuser
|
2017-09-04 18:12:13 -05:00
|
|
|
*/
|
2017-10-27 21:42:53 -05:00
|
|
|
public function getWithPermissions(Subuser $subuser, bool $refresh = false): Subuser;
|
2017-09-04 18:12:13 -05:00
|
|
|
|
2017-09-23 20:45:25 -05:00
|
|
|
/**
|
|
|
|
* Return a subuser and associated permissions given a user_id and server_id.
|
|
|
|
*
|
|
|
|
* @param int $user
|
|
|
|
* @param int $server
|
|
|
|
* @return \Pterodactyl\Models\Subuser
|
|
|
|
*
|
|
|
|
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
|
|
|
|
*/
|
2017-11-05 16:07:50 -06:00
|
|
|
public function getWithPermissionsUsingUserAndServer(int $user, int $server): Subuser;
|
2016-11-26 19:29:57 -05:00
|
|
|
}
|