src/Controller/DominioController.php line 37

Open in your IDE?
  1. <?php
  2. namespace App\Controller;
  3. use Symfony\Component\HttpFoundation\Request;
  4. use Symfony\Component\Routing\Annotation\Route;
  5. class DominioController extends BaseController
  6. {
  7.     public function getProvinciasPorRegionAction$region$sel=-1)
  8.     {
  9.         $em $this->em;
  10.         
  11.         $childs $em->getRepository('App\\Entity\\NmclDominioLocalizacion')->createQueryBuilder('p')
  12.                         ->leftJoin('p.dominioPadre','region')
  13.                         ->where('region.id='.$region)
  14.                         ->orderBy('p.valor')
  15.                         ->getQuery()->getResult();
  16.      
  17.         return $this->render('@crud/Common/comboreloaded.html.twig', array("entities"=>$childs'value'=>$sel));
  18.     }
  19.     
  20.     public function getCantonesPorRegionAction$region$sel=-1)
  21.     {
  22.         $em $this->em;
  23.         
  24.         $childs $em->getRepository('App\\Entity\\NmclDominioLocalizacion')->createQueryBuilder('p')
  25.                         ->leftJoin('p.dominioPadre','provincia')
  26.                         ->leftJoin('provincia.dominioPadre','region')
  27.                         ->where('region.id='.$region)
  28.                         ->orderBy('p.valor')
  29.                         ->getQuery()->getResult();
  30.      
  31.         return $this->render('@crud/Common/comboreloaded.html.twig', array("entities"=>$childs'value'=>$sel));
  32.     }
  33.     
  34.     public function getParroquiasPorRegionAction$region$sel=-1)
  35.     {
  36.         $em $this->em;
  37.         
  38.         $childs $em->getRepository('App\\Entity\\NmclDominioLocalizacion')->createQueryBuilder('p')
  39.                         ->leftJoin('p.dominioPadre','canton')
  40.                         ->leftJoin('canton.dominioPadre','provincia')
  41.                         ->leftJoin('provincia.dominioPadre','region')
  42.                         ->where('region.id='.$region)
  43.                         ->orderBy('p.valor')
  44.                         ->getQuery()->getResult();
  45.      
  46.         return $this->render('@crud/Common/comboreloaded.html.twig', array("entities"=>$childs'value'=>$sel));
  47.     }
  48.     
  49.     public function getCantonesPorProvinciaAction$provincia$sel=-1)
  50.     {
  51.         $em $this->em;
  52.         
  53.         $childs $em->getRepository('App\\Entity\\NmclDominioLocalizacion')->createQueryBuilder('p')
  54.                         ->leftJoin('p.dominioPadre','provincia')
  55.                         ->where('provincia.id='.$provincia)
  56.                         ->orderBy('p.valor')
  57.                         ->getQuery()->getResult();
  58.      
  59.         return $this->render('@crud/Common/comboreloaded.html.twig', array("entities"=>$childs'value'=>$sel));
  60.     }
  61.     public function getParroquiasPorProvinciaAction$provincia$sel=-1)
  62.     {
  63.         $em $this->em;
  64.         
  65.         $childs $em->getRepository('App\\Entity\\NmclDominioLocalizacion')->createQueryBuilder('p')
  66.                         ->leftJoin('p.dominioPadre','canton')
  67.                         ->leftJoin('canton.dominioPadre','provincia')
  68.                         ->where('provincia.id='.$provincia)
  69.                         ->orderBy('p.valor')
  70.                         ->getQuery()->getResult();
  71.      
  72.         return $this->render('@crud/Common/comboreloaded.html.twig', array("entities"=>$childs'value'=>$sel));
  73.     }
  74.     
  75.     public function getParroquiasPorCantonAction$canton$sel=-1)
  76.     {
  77.         $em $this->em;
  78.         
  79.         $childs $em->getRepository('App\\Entity\\NmclDominioLocalizacion')->createQueryBuilder('p')
  80.                         ->leftJoin('p.dominioPadre','canton')
  81.                         ->where('canton.id='.$canton)
  82.                         ->orderBy('p.valor')
  83.                         ->getQuery()->getResult();
  84.      
  85.         return $this->render('@crud/Common/comboreloaded.html.twig', array("entities"=>$childs'value'=>$sel));
  86.     }
  87.     public function getDominiosPorNivelAction$nivel$sel=-1)
  88.     {
  89.         $em $this->em;
  90.         
  91.         $childs $em->getRepository('App\\Entity\\NmclDominioLocalizacion')->createQueryBuilder('p')
  92.                         ->leftJoin('p.nivelLocalizacion','nivel')
  93.                         ->where('nivel.id='.$nivel)
  94.                         ->orderBy('p.valor')
  95.                         ->getQuery()->getResult();
  96.      
  97.         return $this->render('@crud/Common/comboreloaded.html.twig', array("entities"=>$childs'value'=>$sel));
  98.     }
  99. }