2016-11-27 00:29:57 +00:00
|
|
|
<?php
|
2016-12-07 22:46:38 +00:00
|
|
|
|
2017-08-24 02:34:11 +00:00
|
|
|
namespace Pterodactyl\Contracts\Repository;
|
2016-11-27 00:29:57 +00:00
|
|
|
|
2017-10-28 02:42:53 +00:00
|
|
|
use Pterodactyl\Models\Subuser;
|
|
|
|
|
2017-08-24 02:34:11 +00:00
|
|
|
interface SubuserRepositoryInterface extends RepositoryInterface
|
2016-11-27 00:29:57 +00:00
|
|
|
{
|
2017-08-26 23:08:11 +00:00
|
|
|
/**
|
|
|
|
* Return a subuser with the associated server relationship.
|
|
|
|
*
|
2017-10-28 02:42:53 +00:00
|
|
|
* @param \Pterodactyl\Models\Subuser $subuser
|
|
|
|
* @param bool $refresh
|
2017-09-25 02:12:30 +00:00
|
|
|
* @return \Pterodactyl\Models\Subuser
|
2017-08-26 23:08:11 +00:00
|
|
|
*/
|
2017-11-05 18:38:39 +00:00
|
|
|
public function loadServerAndUserRelations(Subuser $subuser, bool $refresh = false): Subuser;
|
2017-08-26 23:08:11 +00:00
|
|
|
|
2017-09-04 23:12:13 +00:00
|
|
|
/**
|
|
|
|
* Return a subuser with the associated permissions relationship.
|
|
|
|
*
|
2017-10-28 02:42:53 +00:00
|
|
|
* @param \Pterodactyl\Models\Subuser $subuser
|
|
|
|
* @param bool $refresh
|
|
|
|
* @return \Pterodactyl\Models\Subuser
|
2017-09-04 23:12:13 +00:00
|
|
|
*/
|
2017-10-28 02:42:53 +00:00
|
|
|
public function getWithPermissions(Subuser $subuser, bool $refresh = false): Subuser;
|
2017-09-04 23:12:13 +00:00
|
|
|
|
2017-09-24 01:45:25 +00: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
|
|
|
|
*/
|
|
|
|
public function getWithPermissionsUsingUserAndServer($user, $server);
|
|
|
|
|
2017-08-26 18:31:18 +00:00
|
|
|
/**
|
|
|
|
* Find a subuser and return with server and permissions relationships.
|
|
|
|
*
|
|
|
|
* @param int $id
|
|
|
|
* @return \Illuminate\Database\Eloquent\Collection
|
|
|
|
*
|
|
|
|
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
|
|
|
|
*/
|
|
|
|
public function getWithServerAndPermissions($id);
|
2017-09-24 01:45:25 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Return a subuser and their associated connection key for a server.
|
|
|
|
*
|
|
|
|
* @param int $user
|
|
|
|
* @param int $server
|
|
|
|
* @return \Pterodactyl\Models\Subuser
|
|
|
|
*
|
|
|
|
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
|
|
|
|
*/
|
|
|
|
public function getWithKey($user, $server);
|
2016-11-27 00:29:57 +00:00
|
|
|
}
|