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:
Dane Everitt 2017-07-08 14:07:51 -05:00
parent 50588a1f54
commit 0deb022093
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
21 changed files with 808 additions and 207 deletions

View file

@ -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)
{