/**
  * @Route("/consulta", name="client_consulta")
  * @Template()
  */
 public function consultaAction()
 {
     $useragent = new Agent();
     if (!$useragent->checkCapable()) {
         return $this->render('::browsernotsupported.html.twig');
         throw new \Exception('Explorador no soportado');
     }
     return array();
 }
 /**
  * @Route("/consulta/{username}", name="consulta_guess")
  * @Template()
  */
 public function consultaAction($username)
 {
     $professional = $this->getDoctrine()->getManager()->getRepository('CoreUserBundle:User')->findOneByUsername($username);
     if (!$professional) {
         throw new \Exception('No professional found');
     }
     $useragent = new Agent();
     if (!$useragent->checkCapable()) {
         return $this->render('::browsernotsupported.html.twig');
         throw new \Exception('Explorador no soportado');
     }
     return array('professional' => $professional);
 }
 /**
  * @Route("/consulta", name="profesional_consulta")
  * @Template()
  */
 public function consultaAction()
 {
     $user = $this->get('security.context')->getToken()->getUser();
     if (!$user) {
         throw new \Exception("User not found");
     }
     $professional = $user->getProfessional();
     if (!$professional) {
         throw new \Exception("Profile not found");
     }
     $styles = $professional->getStyles();
     if (!$styles) {
         return $this->redirect($this->generateUrl('profesional_first_style'));
     }
     $useragent = new Agent();
     $salesManager = $this->get('sales_manager');
     if (!$salesManager->checkIsAvailable('basic_plan')) {
         $this->get('sales_manager')->promoProduct('basic_plan', 'P3M');
         //throw new \Exception('Producto no disponible');
     }
     if (!$useragent->checkCapable()) {
         return $this->render('::browsernotsupported.html.twig');
         throw new \Exception('Explorador no soportado');
     }
     return array();
 }