/** * Fetch all or a subset of resources * * @param array $params * @return ApiProblem|mixed */ public function fetchAll($params = array()) { try { $this->authService->hasRole(['admin', 'salesman']); return $this->productsRepository->findAll(); } catch (\Exception $e) { return new ApiProblem($e->getCode(), $e->getMessage()); } }
public function findAll() { return $this->productRepository->findAll(); }
/** * Fetch all or a subset of resources * * @param array $params * @return ApiProblem|mixed */ public function fetchAll($params = array()) { return $this->repository->findAll(); }
/** * Fetch all or a subset of resources * * @param array $params * @return ApiProblem|mixed */ public function fetchAll($params = array()) { return $this->repository->findAll(); //return new ApiProblem(405, 'The GET method has not been defined for collections'); }