1
1
mirror of https://github.com/pterodactyl/panel.git synced 2024-10-28 04:42:29 +01:00
Pterodactyl-Panel/app/Contracts/Repository/SubuserRepositoryInterface.php

59 lines
1.8 KiB
PHP
Raw Normal View History

<?php
2016-12-07 23:46:38 +01:00
2017-08-24 04:34:11 +02:00
namespace Pterodactyl\Contracts\Repository;
use Pterodactyl\Models\Subuser;
2017-08-24 04:34:11 +02:00
interface SubuserRepositoryInterface extends RepositoryInterface
{
/**
* Return a subuser with the associated server relationship.
*
* @param \Pterodactyl\Models\Subuser $subuser
* @param bool $refresh
* @return \Pterodactyl\Models\Subuser
*/
public function loadServerAndUserRelations(Subuser $subuser, bool $refresh = false): Subuser;
2017-09-05 01:12:13 +02:00
/**
* Return a subuser with the associated permissions relationship.
*
* @param \Pterodactyl\Models\Subuser $subuser
* @param bool $refresh
* @return \Pterodactyl\Models\Subuser
2017-09-05 01:12:13 +02:00
*/
public function getWithPermissions(Subuser $subuser, bool $refresh = false): Subuser;
2017-09-05 01:12:13 +02: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(int $user, int $server): Subuser;
2017-08-26 20:31:18 +02: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);
/**
* 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);
}