/**
* @Rest\Get("/api/person/{id}/localisations")
*/
- public function getLocalisationActions(Request $request)
+ public function getLocalisationsAction(Request $request)
{
$em = $this->getDoctrine()->getManager();
- $localisations = $em->getRepository('App:Localisation')->findBy(['person_id' => $request->get('id')]);
+ $localisations = $em->getRepository('App:Localisation')->findBy(['person' => $request->get('id')]);
if (empty($localisations)) {
- return View::create(['message' => 'Person localisation not found'], Response::HTTP_NOT_FOUND);
+ return View::create(['message' => 'Person localisations not found'], Response::HTTP_NOT_FOUND);
}
- $view = View::create($localisation);
+ $view = View::create($localisations);
$view->setFormat('json');
$viewHandler = $this->get('fos_rest.view_handler');