Loading src/Octopus/Service/Structure/StructureService.php +4 −5 Original line number Diff line number Diff line Loading @@ -53,7 +53,7 @@ class StructureService { public function getStructureTypeByCode($code) { $qb = $this->getEntityManager()->getRepository(StructureType::class)->createQueryBuilder('type') ->andWhere('type.code :code') ->andWhere('type.code = :code') ->setParameter('code', $code) ; Loading Loading @@ -151,17 +151,16 @@ class StructureService { { /** @var StructureType $structureType */ $structureType = $this->getStructureTypeByCode($type); var_dump($structureType); $qb = $this->getEntityManager()->getRepository(Structure::class)->createQueryBuilder('structure') ->addSelect('type')->join('structure.type', 'type') ->andWhere('type.code = :type') ->setParameter('type', $structureType->getId()) ->setParameter('type', $type) ; if ($order) $qb = $qb->orderBy('type.'.$order); if ($order) $qb = $qb->orderBy('structure.'.$order); $qb = $qb->setMaxResults(501); //$qb = $qb->setMaxResults(501); $result = $qb->getQuery()->getResult(); return $result; Loading Loading
src/Octopus/Service/Structure/StructureService.php +4 −5 Original line number Diff line number Diff line Loading @@ -53,7 +53,7 @@ class StructureService { public function getStructureTypeByCode($code) { $qb = $this->getEntityManager()->getRepository(StructureType::class)->createQueryBuilder('type') ->andWhere('type.code :code') ->andWhere('type.code = :code') ->setParameter('code', $code) ; Loading Loading @@ -151,17 +151,16 @@ class StructureService { { /** @var StructureType $structureType */ $structureType = $this->getStructureTypeByCode($type); var_dump($structureType); $qb = $this->getEntityManager()->getRepository(Structure::class)->createQueryBuilder('structure') ->addSelect('type')->join('structure.type', 'type') ->andWhere('type.code = :type') ->setParameter('type', $structureType->getId()) ->setParameter('type', $type) ; if ($order) $qb = $qb->orderBy('type.'.$order); if ($order) $qb = $qb->orderBy('structure.'.$order); $qb = $qb->setMaxResults(501); //$qb = $qb->setMaxResults(501); $result = $qb->getQuery()->getResult(); return $result; Loading