mirror of
https://github.com/MrUnknownDE/panel.git
synced 2026-04-20 23:33:45 +02:00
Update last of existing services to use repositories, includes unit tests
Also update PHPDocs on all the repository interfaces and classes to be correct.
This commit is contained in:
@@ -56,11 +56,17 @@ class UserRepository extends EloquentRepository implements UserRepositoryInterfa
|
||||
$this->config = $config;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function model()
|
||||
{
|
||||
return User::class;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function search($term)
|
||||
{
|
||||
if (empty($term)) {
|
||||
@@ -73,6 +79,9 @@ class UserRepository extends EloquentRepository implements UserRepositoryInterfa
|
||||
return $clone;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getAllUsersWithCounts()
|
||||
{
|
||||
$users = $this->getBuilder()->withCount('servers', 'subuserOf');
|
||||
@@ -87,12 +96,7 @@ class UserRepository extends EloquentRepository implements UserRepositoryInterfa
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a user if they have no servers attached to their account.
|
||||
*
|
||||
* @param int $id
|
||||
* @return bool
|
||||
*
|
||||
* @throws \Pterodactyl\Exceptions\DisplayException
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function deleteIfNoServers($id)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user