heroRepository = $heroRepository; } /** * @Rest\View() */ public function cgetAction() { $heroes = $this->heroRepository->findAll(); return $this->view($heroes, Response::HTTP_OK); } }