1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-14 07:02:34 +01:00
invoiceninja/app/Services/TokenService.php
2016-05-23 19:52:20 +03:00

33 lines
770 B
PHP

<?php namespace App\Services;
use URL;
use App\Services\BaseService;
use App\Ninja\Repositories\TokenRepository;
use App\Ninja\Datatables\TokenDatatable;
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;
}
public function getDatatable($userId)
{
$datatable = new TokenDatatable(false);
$query = $this->tokenRepo->find($userId);
return $this->datatableService->createDatatable($datatable, $query);
}
}