<?php
namespace App\Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Annotation\Route;
class DominioController extends BaseController
{
public function getProvinciasPorRegionAction( $region, $sel=-1)
{
$em = $this->em;
$childs = $em->getRepository('App\\Entity\\NmclDominioLocalizacion')->createQueryBuilder('p')
->leftJoin('p.dominioPadre','region')
->where('region.id='.$region)
->orderBy('p.valor')
->getQuery()->getResult();
return $this->render('@crud/Common/comboreloaded.html.twig', array("entities"=>$childs, 'value'=>$sel));
}
public function getCantonesPorRegionAction( $region, $sel=-1)
{
$em = $this->em;
$childs = $em->getRepository('App\\Entity\\NmclDominioLocalizacion')->createQueryBuilder('p')
->leftJoin('p.dominioPadre','provincia')
->leftJoin('provincia.dominioPadre','region')
->where('region.id='.$region)
->orderBy('p.valor')
->getQuery()->getResult();
return $this->render('@crud/Common/comboreloaded.html.twig', array("entities"=>$childs, 'value'=>$sel));
}
public function getParroquiasPorRegionAction( $region, $sel=-1)
{
$em = $this->em;
$childs = $em->getRepository('App\\Entity\\NmclDominioLocalizacion')->createQueryBuilder('p')
->leftJoin('p.dominioPadre','canton')
->leftJoin('canton.dominioPadre','provincia')
->leftJoin('provincia.dominioPadre','region')
->where('region.id='.$region)
->orderBy('p.valor')
->getQuery()->getResult();
return $this->render('@crud/Common/comboreloaded.html.twig', array("entities"=>$childs, 'value'=>$sel));
}
public function getCantonesPorProvinciaAction( $provincia, $sel=-1)
{
$em = $this->em;
$childs = $em->getRepository('App\\Entity\\NmclDominioLocalizacion')->createQueryBuilder('p')
->leftJoin('p.dominioPadre','provincia')
->where('provincia.id='.$provincia)
->orderBy('p.valor')
->getQuery()->getResult();
return $this->render('@crud/Common/comboreloaded.html.twig', array("entities"=>$childs, 'value'=>$sel));
}
public function getParroquiasPorProvinciaAction( $provincia, $sel=-1)
{
$em = $this->em;
$childs = $em->getRepository('App\\Entity\\NmclDominioLocalizacion')->createQueryBuilder('p')
->leftJoin('p.dominioPadre','canton')
->leftJoin('canton.dominioPadre','provincia')
->where('provincia.id='.$provincia)
->orderBy('p.valor')
->getQuery()->getResult();
return $this->render('@crud/Common/comboreloaded.html.twig', array("entities"=>$childs, 'value'=>$sel));
}
public function getParroquiasPorCantonAction( $canton, $sel=-1)
{
$em = $this->em;
$childs = $em->getRepository('App\\Entity\\NmclDominioLocalizacion')->createQueryBuilder('p')
->leftJoin('p.dominioPadre','canton')
->where('canton.id='.$canton)
->orderBy('p.valor')
->getQuery()->getResult();
return $this->render('@crud/Common/comboreloaded.html.twig', array("entities"=>$childs, 'value'=>$sel));
}
public function getDominiosPorNivelAction( $nivel, $sel=-1)
{
$em = $this->em;
$childs = $em->getRepository('App\\Entity\\NmclDominioLocalizacion')->createQueryBuilder('p')
->leftJoin('p.nivelLocalizacion','nivel')
->where('nivel.id='.$nivel)
->orderBy('p.valor')
->getQuery()->getResult();
return $this->render('@crud/Common/comboreloaded.html.twig', array("entities"=>$childs, 'value'=>$sel));
}
}