mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-13 22:54:25 +01:00
0fbda85a59
- Removed unused uses - Type hinting for method parameters - Removed commented code - Introduced comments for classes and methods - Short array syntax
53 lines
1.1 KiB
PHP
53 lines
1.1 KiB
PHP
<?php namespace App\Services;
|
|
|
|
use App\Ninja\Repositories\TaxRateRepository;
|
|
use App\Ninja\Datatables\TaxRateDatatable;
|
|
|
|
/**
|
|
* 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);
|
|
}
|
|
}
|