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:
parent
50588a1f54
commit
0deb022093
21 changed files with 808 additions and 207 deletions
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue