/** * @Route("/index", name="page_home_admin") * @Method("GET") */ public function indexAction(Request $request) { if (!$request->getSession()->get(Generalkeys::LABEL_STATUS)) { return $this->redirectToRoute('admin_login'); } $ventas = $this->getDoctrine()->getRepository('VisitaYucatanBundle:Venta')->findBy([], ['id' => 'DESC']); return $this->render('VisitaYucatanBundle:Default:index.html.twig', array("ventas" => VentaUtils::getAllVentas($ventas))); }