invoiceninja/app/Services/ProductService.php

43 lines
902 B
PHP
Raw Normal View History

2015-11-06 00:37:04 +02:00
<?php namespace App\Services;
use Utils;
use DB;
use Auth;
use URL;
use App\Services\BaseService;
use App\Ninja\Repositories\ProductRepository;
2016-05-23 19:52:20 +03:00
use App\Ninja\Datatables\ProductDatatable;
2015-11-06 00:37:04 +02:00
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)
{
2016-05-23 19:52:20 +03:00
$datatable = new ProductDatatable(false);
2015-11-06 00:37:04 +02:00
$query = $this->productRepo->find($accountId);
2016-05-23 19:52:20 +03:00
return $this->datatableService->createDatatable($datatable, $query);
2015-11-06 00:37:04 +02:00
}
2016-05-23 19:52:20 +03:00
}