public function listAction(Request $request)
 {
     $em = $this->getDoctrine()->getManager();
     $url = $this->generateUrl('project_back_' . self::NOMBRE_RUTA . '_list');
     $data = new Bookies();
     $form = $this->createForm(self::NOMBRE_RUTA . '_filtro', $data);
     if ($this->getRequest()->isMethod('POST')) {
         $form->bind($this->getRequest());
         if ($form->isValid()) {
             $filtro = new Filtro(self::NOMBRE_CLASE, $em);
             $filtro->setDQLInicial();
             $filtro->setDataTexto('nombre', $data->getNombre());
             $filtro->setDataTexto('url', $data->getUrl());
             $filtro->setDataBoolean('patrocinador', $data->getPatrocinador());
             $filtro->setDataBoolean('licenciaEsp', $data->getLicenciaEsp());
             $filtro->setOrder();
             $filtro->setQuery();
             $filtro->setParametroTexto('nombre', $data->getNombre());
             $filtro->setParametroTexto('url', $data->getUrl());
             $filtro->setParametroBoolean('patrocinador', $data->getPatrocinador());
             $filtro->setParametroBoolean('licenciaEsp', $data->getLicenciaEsp());
             $query = $filtro->getQuery();
         }
     } else {
         $dql = "SELECT o FROM ProjectUserBundle:" . self::NOMBRE_CLASE . " o order by o.id DESC ";
         $query = $em->createQuery($dql);
     }
     $paginator = $this->get('knp_paginator');
     $pagination = $paginator->paginate($query, $this->getRequest()->query->get('page', 1), 30);
     $array = array('pagination' => $pagination, 'url' => $url);
     $array['nombreClase'] = self::NOMBRE_CLASE;
     $array['nombreRuta'] = self::NOMBRE_RUTA;
     $array['form'] = $form->createView();
     return $this->render('ProjectBackBundle:' . self::NOMBRE_CLASE . ':list.html.twig', $array);
 }
 public function listAction(Request $request)
 {
     $em = $this->getDoctrine()->getManager();
     $url = $this->generateUrl('project_back_' . self::NOMBRE_RUTA . '_list');
     if ($this->getRequest()->isMethod('POST')) {
         $form->bind($this->getRequest());
         if ($form->isValid()) {
             $filtro = new Filtro(self::NOMBRE_CLASE, $em);
             $filtro->setDQLInicial();
             $filtro->setDataTexto('trackSite', $data->getTrackSite());
             $filtro->setDataBoolean('bookie', $data->getBookie());
             $filtro->setOrder();
             $filtro->setQuery();
             $filtro->setParametroTexto('trackSite', $data->getTrackSite());
             $filtro->setParametroBoolean('bookie', $data->getBookie());
             $query = $filtro->getQuery();
         }
     }
     /*else {
     			$dql = "SELECT o FROM ProjectUserBundle:".self::NOMBRE_CLASE." o  ";
     			$query = $em -> createQuery($dql);
     		}
     
     		$paginator = $this -> get('knp_paginator');
     		$pagination = $paginator-> paginate($query, $this-> getRequest()-> query-> get('page', 1), 30);*/
     $pagination = array('getTotalItemCount' => 0);
     $array = array('pagination' => $pagination, 'url' => $url);
     $array['nombreClase'] = self::NOMBRE_CLASE;
     $array['nombreRuta'] = self::NOMBRE_RUTA;
     return $this->render('ProjectBackBundle:' . self::NOMBRE_CLASE . ':list.html.twig', $array);
 }