mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-10-26 09:02:53 -04:00 
			
		
		
		
	- Removed unused uses - Type hinting for method parameters - Removed commented code - Introduced comments for classes and methods - Short array syntax
		
			
				
	
	
		
			53 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			53 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
| <?php namespace App\Services;
 | |
| 
 | |
| use App\Ninja\Repositories\TokenRepository;
 | |
| use App\Ninja\Datatables\TokenDatatable;
 | |
| 
 | |
| /**
 | |
|  * Class TokenService
 | |
|  */
 | |
| class TokenService extends BaseService
 | |
| {
 | |
|     /**
 | |
|      * @var TokenRepository
 | |
|      */
 | |
|     protected $tokenRepo;
 | |
| 
 | |
|     /**
 | |
|      * @var DatatableService
 | |
|      */
 | |
|     protected $datatableService;
 | |
| 
 | |
|     /**
 | |
|      * TokenService constructor.
 | |
|      *
 | |
|      * @param TokenRepository $tokenRepo
 | |
|      * @param DatatableService $datatableService
 | |
|      */
 | |
|     public function __construct(TokenRepository $tokenRepo, DatatableService $datatableService)
 | |
|     {
 | |
|         $this->tokenRepo = $tokenRepo;
 | |
|         $this->datatableService = $datatableService;
 | |
|     }
 | |
| 
 | |
|     /**
 | |
|      * @return TokenRepository
 | |
|      */
 | |
|     protected function getRepo()
 | |
|     {
 | |
|         return $this->tokenRepo;
 | |
|     }
 | |
| 
 | |
|     /**
 | |
|      * @param $userId
 | |
|      * @return \Illuminate\Http\JsonResponse
 | |
|      */
 | |
|     public function getDatatable($userId)
 | |
|     {
 | |
|         $datatable = new TokenDatatable(false);
 | |
|         $query = $this->tokenRepo->find($userId);
 | |
| 
 | |
|         return $this->datatableService->createDatatable($datatable, $query);
 | |
|     }
 | |
| }
 |