1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-14 23:22:52 +01:00
invoiceninja/app/Services/UserService.php
Holger Lösken 0fbda85a59 Code Refactoring
- Removed unused uses
- Type hinting for method parameters
- Removed commented code
- Introduced comments for classes and methods
- Short array syntax
2016-07-03 16:19:22 +00:00

53 lines
1.1 KiB
PHP

<?php namespace App\Services;
use App\Ninja\Repositories\UserRepository;
use App\Ninja\Datatables\UserDatatable;
/**
* Class UserService
*/
class UserService extends BaseService
{
/**
* @var UserRepository
*/
protected $userRepo;
/**
* @var DatatableService
*/
protected $datatableService;
/**
* UserService constructor.
*
* @param UserRepository $userRepo
* @param DatatableService $datatableService
*/
public function __construct(UserRepository $userRepo, DatatableService $datatableService)
{
$this->userRepo = $userRepo;
$this->datatableService = $datatableService;
}
/**
* @return UserRepository
*/
protected function getRepo()
{
return $this->userRepo;
}
/**
* @param $accountId
* @return \Illuminate\Http\JsonResponse
*/
public function getDatatable($accountId)
{
$datatable = new UserDatatable(false);
$query = $this->userRepo->find($accountId);
return $this->datatableService->createDatatable($datatable, $query);
}
}