1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-08 20:22:42 +01:00
invoiceninja/app/Services/TaxRateService.php
2017-01-30 21:40:43 +02:00

56 lines
1.2 KiB
PHP

<?php
namespace App\Services;
use App\Ninja\Datatables\TaxRateDatatable;
use App\Ninja\Repositories\TaxRateRepository;
/**
* Class TaxRateService.
*/
class TaxRateService extends BaseService
{
/**
* @var TaxRateRepository
*/
protected $taxRateRepo;
/**
* @var DatatableService
*/
protected $datatableService;
/**
* TaxRateService constructor.
*
* @param TaxRateRepository $taxRateRepo
* @param DatatableService $datatableService
*/
public function __construct(TaxRateRepository $taxRateRepo, DatatableService $datatableService)
{
$this->taxRateRepo = $taxRateRepo;
$this->datatableService = $datatableService;
}
/**
* @return TaxRateRepository
*/
protected function getRepo()
{
return $this->taxRateRepo;
}
/**
* @param $accountId
*
* @return \Illuminate\Http\JsonResponse
*/
public function getDatatable($accountId)
{
$datatable = new TaxRateDatatable(false);
$query = $this->taxRateRepo->find($accountId);
return $this->datatableService->createDatatable($datatable, $query);
}
}