repository = $repository; } /** * @return mixed */ public function getAll() { try { $roles = $this->repository->getDefaultOnes(); $response = new PagingResponse ( count($roles), count($roles), 1, 1, $roles ); return $this->ok($response->toArray($expand = Input::get('expand', ''))); } catch (ValidationException $ex1) { Log::warning($ex1); return $this->error412(array($ex1->getMessage())); } catch (EntityNotFoundException $ex2) { Log::warning($ex2); return $this->error404(array('message' => $ex2->getMessage())); } catch (\Exception $ex) { Log::error($ex); return $this->error500($ex); } } }