1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-14 07:02:34 +01:00
invoiceninja/app/Services/AccountGatewayService.php

52 lines
1.2 KiB
PHP
Raw Normal View History

2015-11-05 23:37:04 +01:00
<?php namespace App\Services;
use App\Ninja\Repositories\AccountGatewayRepository;
2016-05-23 18:52:20 +02:00
use App\Ninja\Datatables\AccountGatewayDatatable;
2015-11-05 23:37:04 +01:00
/**
* Class AccountGatewayService
*/
2015-11-05 23:37:04 +01:00
class AccountGatewayService extends BaseService
{
/**
* @var AccountGatewayRepository
*/
2015-11-05 23:37:04 +01:00
protected $accountGatewayRepo;
/**
* @var DatatableService
*/
2015-11-05 23:37:04 +01:00
protected $datatableService;
/**
* AccountGatewayService constructor.
*
* @param AccountGatewayRepository $accountGatewayRepo
* @param DatatableService $datatableService
*/
2015-11-05 23:37:04 +01:00
public function __construct(AccountGatewayRepository $accountGatewayRepo, DatatableService $datatableService)
{
$this->accountGatewayRepo = $accountGatewayRepo;
$this->datatableService = $datatableService;
}
/**
* @return AccountGatewayRepository
*/
2015-11-05 23:37:04 +01:00
protected function getRepo()
{
return $this->accountGatewayRepo;
}
/**
* @param $accountId
* @return \Illuminate\Http\JsonResponse
*/
2015-11-05 23:37:04 +01:00
public function getDatatable($accountId)
{
$query = $this->accountGatewayRepo->find($accountId);
2016-05-23 18:52:20 +02:00
return $this->datatableService->createDatatable(new AccountGatewayDatatable(false), $query);
2015-11-05 23:37:04 +01:00
}
2016-05-23 18:52:20 +02:00
}