From 9e71bdc54747a36c661ce304a330a2d6dc43b80c Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Wed, 27 Jun 2018 22:17:18 +0200 Subject: [PATCH] Enable @Rest\View annotations. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/Controller/PersonController.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Controller/PersonController.php b/src/Controller/PersonController.php index af3c28a..6ee3fdf 100644 --- a/src/Controller/PersonController.php +++ b/src/Controller/PersonController.php @@ -98,17 +98,17 @@ class PersonController extends FOSRestController } /** + * @Rest\View() * @Rest\Get( * path = "/api/person/{id}", * name = "show_person", * requirements = {"id"="\d+"} * ) - * @Rest\View() */ public function showPerson(Request $request) { $em = $this->getDoctrine()->getManager(); - $person = $em->getRepository('App::Person')->find($request->get('id')); + $person = $em->getRepository('App:Person')->find($request->get('id')); if (empty($person)) { return new JsonResponse(['message' => 'Person not found'], Response::HTTP_NOT_FOUND); @@ -148,7 +148,7 @@ class PersonController extends FOSRestController public function showPersonFriends(Request $request) { $em = $this->getDoctrine()->getManager(); - $person = $em->getRepository('App::Person')->find($request->get('id')); + $person = $em->getRepository('App:Person')->find($request->get('id')); if (empty($person)) { return new JsonResponse(['message' => 'Person not found'], Response::HTTP_NOT_FOUND); -- 2.34.1