Repository interface improvements
This commit is contained in:
parent
1f4f6024cc
commit
bc3366b10d
23 changed files with 829 additions and 179 deletions
|
@ -30,19 +30,15 @@ use Pterodactyl\Contracts\Repository\UserRepositoryInterface;
|
|||
use Pterodactyl\Exceptions\DisplayException;
|
||||
use Pterodactyl\Exceptions\Repository\RecordNotFoundException;
|
||||
use Pterodactyl\Models\User;
|
||||
use Pterodactyl\Repositories\Eloquent\Attributes\SearchableRepository;
|
||||
|
||||
class UserRepository extends EloquentRepository implements UserRepositoryInterface
|
||||
class UserRepository extends SearchableRepository implements UserRepositoryInterface
|
||||
{
|
||||
/**
|
||||
* @var \Illuminate\Contracts\Config\Repository
|
||||
*/
|
||||
protected $config;
|
||||
|
||||
/**
|
||||
* @var bool|array
|
||||
*/
|
||||
protected $searchTerm = false;
|
||||
|
||||
/**
|
||||
* UserRepository constructor.
|
||||
*
|
||||
|
@ -64,21 +60,6 @@ class UserRepository extends EloquentRepository implements UserRepositoryInterfa
|
|||
return User::class;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function search($term)
|
||||
{
|
||||
if (empty($term)) {
|
||||
return $this;
|
||||
}
|
||||
|
||||
$clone = clone $this;
|
||||
$clone->searchTerm = $term;
|
||||
|
||||
return $clone;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue