Path: blob/1.0-develop/app/Contracts/Repository/ServerRepositoryInterface.php
10279 views
<?php12namespace Pterodactyl\Contracts\Repository;34use Pterodactyl\Models\Server;5use Illuminate\Support\Collection;6use Illuminate\Contracts\Pagination\LengthAwarePaginator;78interface ServerRepositoryInterface extends RepositoryInterface9{10/**11* Load the egg relations onto the server model.12*/13public function loadEggRelations(Server $server, bool $refresh = false): Server;1415/**16* Return a collection of servers with their associated data for rebuild operations.17*/18public function getDataForRebuild(?int $server = null, ?int $node = null): Collection;1920/**21* Return a collection of servers with their associated data for reinstall operations.22*/23public function getDataForReinstall(?int $server = null, ?int $node = null): Collection;2425/**26* Return a server model and all variables associated with the server.27*28* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException29*/30public function findWithVariables(int $id): Server;3132/**33* Get the primary allocation for a given server. If a model is passed into34* the function, load the allocation relationship onto it. Otherwise, find and35* return the server from the database.36*/37public function getPrimaryAllocation(Server $server, bool $refresh = false): Server;3839/**40* Return enough data to be used for the creation of a server via the daemon.41*/42public function getDataForCreation(Server $server, bool $refresh = false): Server;4344/**45* Load associated databases onto the server model.46*/47public function loadDatabaseRelations(Server $server, bool $refresh = false): Server;4849/**50* Get data for use when updating a server on the Daemon. Returns an array of51* the egg which is used for build and rebuild. Only loads relations52* if they are missing, or refresh is set to true.53*/54public function getDaemonServiceData(Server $server, bool $refresh = false): array;5556/**57* Return a server by UUID.58*59* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException60*/61public function getByUuid(string $uuid): Server;6263/**64* Check if a given UUID and UUID-Short string are unique to a server.65*/66public function isUniqueUuidCombo(string $uuid, string $short): bool;6768/**69* Returns all the servers that exist for a given node in a paginated response.70*/71public function loadAllServersForNode(int $node, int $limit): LengthAwarePaginator;72}737475