Merge branch 'develop' into feature/bulk-reinstall-command

This commit is contained in:
Dane Everitt 2019-07-26 11:04:48 -04:00 committed by GitHub
commit 215351eeb3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
308 changed files with 18740 additions and 3400 deletions

View file

@ -2,6 +2,7 @@
namespace Pterodactyl\Repositories\Eloquent;
use Pterodactyl\Models\Node;
use Pterodactyl\Models\User;
use Webmozart\Assert\Assert;
use Pterodactyl\Models\Server;
@ -358,4 +359,20 @@ class ServerRepository extends EloquentRepository implements ServerRepositoryInt
{
return $this->getBuilder()->where('suspended', true)->count();
}
/**
* Returns all of the servers that exist for a given node in a paginated response.
*
* @param int $node
* @param int $limit
*
* @return \Illuminate\Contracts\Pagination\LengthAwarePaginator
*/
public function loadAllServersForNode(int $node, int $limit): LengthAwarePaginator
{
return $this->getBuilder()
->with(['user', 'nest', 'egg'])
->where('node_id', '=', $node)
->paginate($limit);
}
}