mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-14 07:02:34 +01:00
30 lines
800 B
PHP
30 lines
800 B
PHP
<?php namespace App\Services;
|
|
|
|
use Utils;
|
|
use App\Models\Client;
|
|
use App\Services\BaseService;
|
|
use App\Ninja\Repositories\ActivityRepository;
|
|
use App\Ninja\Datatables\ActivityDatatable;
|
|
|
|
class ActivityService extends BaseService
|
|
{
|
|
protected $activityRepo;
|
|
protected $datatableService;
|
|
|
|
public function __construct(ActivityRepository $activityRepo, DatatableService $datatableService)
|
|
{
|
|
$this->activityRepo = $activityRepo;
|
|
$this->datatableService = $datatableService;
|
|
}
|
|
|
|
public function getDatatable($clientPublicId = null)
|
|
{
|
|
$clientId = Client::getPrivateId($clientPublicId);
|
|
|
|
$query = $this->activityRepo->findByClientId($clientId);
|
|
|
|
return $this->datatableService->createDatatable(new ActivityDatatable(false), $query);
|
|
}
|
|
|
|
}
|