Loading module/Application/src/Application/Controller/SubstitutionController.php +1 −1 Changes for module/Application/src/Application/Controller/SubstitutionController.php: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -35,7 +35,7 @@ class SubstitutionController extends AbstractController /** Affiche l'index d'un type de structure donnée */ public function indexStructureAction() { $type = $this->params()->fromRoute("type"); $structures = $this->getStructureService()->getStructuresSubstituantes($type); $structures = $this->getStructureService()->getStructuresSubstituantes($type, 'libelle'); return new ViewModel([ 'type' => $type, Loading module/Application/src/Application/Service/Structure/StructureService.php +3 −1 Changes for module/Application/src/Application/Service/Structure/StructureService.php: 3 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -331,7 +331,7 @@ class StructureService extends BaseService * Cette fonction retourne la liste des structures qui substitue d'autres structures * @return Structure[] */ public function getStructuresSubstituantes($type = null) public function getStructuresSubstituantes($type = null, $order = null) { $qb = $this->getEntityManager()->getRepository(Structure::class)->createQueryBuilder("s") ->andWhere("s.structuresSubstituees IS NOT EMPTY"); Loading @@ -340,6 +340,8 @@ class StructureService extends BaseService $qb->andWhere("s.typeStructure = :type") ->setParameter("type", $typeStructure); } if ($order) $qb->orderBy('s.'.$order); $results = $qb->getQuery()->getResult(); return $results; Loading Loading
module/Application/src/Application/Controller/SubstitutionController.php +1 −1 Changes for module/Application/src/Application/Controller/SubstitutionController.php: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -35,7 +35,7 @@ class SubstitutionController extends AbstractController /** Affiche l'index d'un type de structure donnée */ public function indexStructureAction() { $type = $this->params()->fromRoute("type"); $structures = $this->getStructureService()->getStructuresSubstituantes($type); $structures = $this->getStructureService()->getStructuresSubstituantes($type, 'libelle'); return new ViewModel([ 'type' => $type, Loading
module/Application/src/Application/Service/Structure/StructureService.php +3 −1 Changes for module/Application/src/Application/Service/Structure/StructureService.php: 3 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -331,7 +331,7 @@ class StructureService extends BaseService * Cette fonction retourne la liste des structures qui substitue d'autres structures * @return Structure[] */ public function getStructuresSubstituantes($type = null) public function getStructuresSubstituantes($type = null, $order = null) { $qb = $this->getEntityManager()->getRepository(Structure::class)->createQueryBuilder("s") ->andWhere("s.structuresSubstituees IS NOT EMPTY"); Loading @@ -340,6 +340,8 @@ class StructureService extends BaseService $qb->andWhere("s.typeStructure = :type") ->setParameter("type", $typeStructure); } if ($order) $qb->orderBy('s.'.$order); $results = $qb->getQuery()->getResult(); return $results; Loading