Skip to content
Snippets Groups Projects
Commit 632acc87 authored by Jean-Philippe Metivier's avatar Jean-Philippe Metivier
Browse files

Correction de bug dans la recherche de structure

parent 0d67c435
No related branches found
No related tags found
No related merge requests found
......@@ -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)
;
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment