Removed unused interface functions
This commit is contained in:
parent
8b4bd3945d
commit
9410a54c98
2 changed files with 0 additions and 60 deletions
|
@ -2,25 +2,6 @@
|
|||
|
||||
namespace Pterodactyl\Contracts\Repository;
|
||||
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Contracts\Pagination\LengthAwarePaginator;
|
||||
use Pterodactyl\Contracts\Repository\Attributes\SearchableInterface;
|
||||
|
||||
interface UserRepositoryInterface extends RepositoryInterface
|
||||
{
|
||||
/**
|
||||
* Return all matching models for a user in a format that can be used for dropdowns.
|
||||
*
|
||||
* @param string|null $query
|
||||
* @return \Illuminate\Support\Collection
|
||||
*/
|
||||
public function filterUsersByQuery(?string $query): Collection;
|
||||
|
||||
/**
|
||||
* Returns a user with the given id in a format that can be used for dropdowns.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \Pterodactyl\Models\Model
|
||||
*/
|
||||
public function filterById(int $id): \Pterodactyl\Models\Model;
|
||||
}
|
||||
|
|
|
@ -3,8 +3,6 @@
|
|||
namespace Pterodactyl\Repositories\Eloquent;
|
||||
|
||||
use Pterodactyl\Models\User;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Contracts\Pagination\LengthAwarePaginator;
|
||||
use Pterodactyl\Contracts\Repository\UserRepositoryInterface;
|
||||
|
||||
class UserRepository extends EloquentRepository implements UserRepositoryInterface
|
||||
|
@ -18,43 +16,4 @@ class UserRepository extends EloquentRepository implements UserRepositoryInterfa
|
|||
{
|
||||
return User::class;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return all matching models for a user in a format that can be used for dropdowns.
|
||||
*
|
||||
* @param string|null $query
|
||||
* @return \Illuminate\Support\Collection
|
||||
*/
|
||||
public function filterUsersByQuery(?string $query): Collection
|
||||
{
|
||||
$this->setColumns([
|
||||
'id', 'email', 'username', 'name_first', 'name_last',
|
||||
]);
|
||||
|
||||
$instance = $this->getBuilder()->get($this->getColumns());
|
||||
|
||||
return $instance->transform(function ($item) {
|
||||
$item->md5 = md5(strtolower($item->email));
|
||||
|
||||
return $item;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a user with the given id in a format that can be used for dropdowns.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \Pterodactyl\Models\Model
|
||||
*/
|
||||
public function filterById(int $id): \Pterodactyl\Models\Model
|
||||
{
|
||||
$this->setColumns([
|
||||
'id', 'email', 'username', 'name_first', 'name_last',
|
||||
]);
|
||||
|
||||
$model = $this->getBuilder()->findOrFail($id, $this->getColumns())->getModel();
|
||||
$model->md5 = md5(strtolower($model->email));
|
||||
|
||||
return $model;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue