Commit 7a00ad6c authored by Jean-Philippe Metivier's avatar Jean-Philippe Metivier
Browse files

Ajout de select dans le service structure

parent dd7431df
Loading
Loading
Loading
Loading
+8 −1
Changes for module/Application/src/Application/Service/Structure/StructureService.php: 8 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -588,6 +588,9 @@ class StructureService extends BaseService
    public function getStructuresSubstituablesByType($type)
    {
        $qb = $this->getEntityManager()->getRepository($this->getEntityByType($type))->createQueryBuilder('structureConcrete')
            ->addSelect('structure')
            ->addSelect('substitutionTo')
            ->addSelect('substitutionFrom')
            ->join('structureConcrete.structure', 'structure')
            ->leftJoin('structure.structuresSubstituees', 'substitutionFrom')
            ->leftJoin('structure.structureSubstituante', 'substitutionTo')
@@ -633,8 +636,12 @@ class StructureService extends BaseService
     */
    public function getStructuresSubstitueesUtilisablesByType($type) {
        $qb = $this->getEntityManager()->getRepository($this->getEntityByType($type))->createQueryBuilder('structureConcrete')
            ->addSelect('structure')
            ->addSelect('substitutionTo')
            ->addSelect('substitutionFrom')
            ->join('structureConcrete.structure', 'structure')
            ->leftJoin('structure.structuresSubstituees', 'substitutionFrom')
            ->leftJoin('structure.structureSubstituante', 'substitutionTo')
            ->andWhere('substitutionFrom.id IS NULL')
        ;

@@ -650,6 +657,7 @@ class StructureService extends BaseService
    public function getStructuresConcreteByTypeAndStructureId($type, $structureId)
    {
        $qb = $this->getEntityManager()->getRepository($this->getEntityByType($type))->createQueryBuilder('structureConcrete')
            ->addSelect('structure')
            ->join('structureConcrete.structure', 'structure')
            ->andWhere('structure.id = :structureId')
            ->setParameter('structureId', $structureId)
@@ -665,7 +673,6 @@ class StructureService extends BaseService
        return $result;
    }

    // TODO mettre dans le service ...
    /** Identifie les structures substituables en utilisant le sourceCode */
    public function checkStructure($type)
    {