$person = $em->getRepository('App:Person')->find($request->get('id'));
if (empty($person)) {
- return new JsonResponse(['message' => 'Person not found'], Response::HTTP_NOT_FOUND);
+ return View::create(['message' => 'Person not found'], Response::HTTP_NOT_FOUND);
}
$person->setFirstName($request->get('firstname'));
$person = $em->getRepository('App:Person')->find($request->get('id'));
if (empty($person)) {
- return new JsonResponse(['message' => 'Person not found'], Response::HTTP_NOT_FOUND);
+ return View::create(['message' => 'Person not found'], Response::HTTP_NOT_FOUND);
}
$view = View::create($person);
$person = $em->getRepository('App:Person')->find($request->get('email'));
if (empty($person)) {
- return new JsonResponse(['message' => 'Person not found'], Response::HTTP_NOT_FOUND);
+ return View::create(['message' => 'Person not found'], Response::HTTP_NOT_FOUND);
}
$view = View::create($person);
$person = $em->getRepository('App:Person')->find($request->get('id'));
if (empty($person)) {
- return new JsonResponse(['message' => 'Person not found'], Response::HTTP_NOT_FOUND);
+ return View::create(['message' => 'Person not found'], Response::HTTP_NOT_FOUND);
}
$view = View::create($person->getFriends());
$person = $em->getRepository('App:Person')->find($request->get('email'));
if (empty($person)) {
- return new JsonResponse(['message' => 'Person not found'], Response::HTTP_NOT_FOUND);
+ return View::create(['message' => 'Person not found'], Response::HTTP_NOT_FOUND);
}
$view = View::create($person->getFriends());