1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-09 20:52:56 +01:00
invoiceninja/app/Services/ProductService.php
2016-05-23 19:52:20 +03:00

43 lines
902 B
PHP

<?php namespace App\Services;
use Utils;
use DB;
use Auth;
use URL;
use App\Services\BaseService;
use App\Ninja\Repositories\ProductRepository;
use App\Ninja\Datatables\ProductDatatable;
class ProductService extends BaseService
{
protected $datatableService;
protected $productRepo;
public function __construct(DatatableService $datatableService, ProductRepository $productRepo)
{
$this->datatableService = $datatableService;
$this->productRepo = $productRepo;
}
protected function getRepo()
{
return $this->productRepo;
}
/*
public function save()
{
return null;
}
*/
public function getDatatable($accountId)
{
$datatable = new ProductDatatable(false);
$query = $this->productRepo->find($accountId);
return $this->datatableService->createDatatable($datatable, $query);
}
}