/** * @ParamConverter("servicio", class="AdminBundle:Servicio", options={"id" = "servicio"}) * @ParamConverter("servicioItem", class="AdminBundle:ServicioItem", options={"id" = "servicioItem"}) */ public function deleteItemAction(Servicio $servicio, ServicioItem $servicioItem) { if ($servicioItem->getServicio()->getId() == $servicio->getId()) { $em = $this->getDoctrine()->getManager(); $em->remove($servicioItem); $em->flush(); $view = $this->view(null, 200); } else { $view = $this->view(null, 500); } return $this->get('fos_rest.view_handler')->handle($view); }
/** * Muestra las indicaciones necesarias para llegar a un servicio seleccionado * desde un punto de inicio seleccionado por el usuario. * * @Template("FrontendBundle:Informacion:indicaciones.html.twig") * @param ServicioItem $item * @param $puntoInicio * @return array */ public function indicacionesAction(ServicioItem $item, $puntoInicio) { $manager = $this->get('adminbundle.manager.maparecorrido'); $puntoInicio = intval($puntoInicio); $indicaciones = $manager->getRutaCortaAlServicio($puntoInicio, $item->getId()); return array('indicaciones' => $indicaciones, 'item' => $item); }