2015-11-05 23:37:04 +01:00
|
|
|
<?php namespace App\Services;
|
|
|
|
|
|
|
|
use URL;
|
|
|
|
use App\Services\BaseService;
|
|
|
|
use App\Ninja\Repositories\TokenRepository;
|
2016-05-23 18:52:20 +02:00
|
|
|
use App\Ninja\Datatables\TokenDatatable;
|
2015-11-05 23:37:04 +01:00
|
|
|
|
|
|
|
class TokenService extends BaseService
|
|
|
|
{
|
|
|
|
protected $tokenRepo;
|
|
|
|
protected $datatableService;
|
|
|
|
|
|
|
|
public function __construct(TokenRepository $tokenRepo, DatatableService $datatableService)
|
|
|
|
{
|
|
|
|
$this->tokenRepo = $tokenRepo;
|
|
|
|
$this->datatableService = $datatableService;
|
|
|
|
}
|
|
|
|
|
|
|
|
protected function getRepo()
|
|
|
|
{
|
|
|
|
return $this->tokenRepo;
|
|
|
|
}
|
|
|
|
|
2016-05-08 20:50:35 +02:00
|
|
|
public function getDatatable($userId)
|
2015-11-05 23:37:04 +01:00
|
|
|
{
|
2016-05-23 18:52:20 +02:00
|
|
|
$datatable = new TokenDatatable(false);
|
2016-05-08 20:50:35 +02:00
|
|
|
$query = $this->tokenRepo->find($userId);
|
2015-11-05 23:37:04 +01:00
|
|
|
|
2016-05-23 18:52:20 +02:00
|
|
|
return $this->datatableService->createDatatable($datatable, $query);
|
2015-11-05 23:37:04 +01:00
|
|
|
}
|
|
|
|
|
2016-05-23 18:52:20 +02:00
|
|
|
}
|