MerchantResolver::class, 'section_resolver' => SectionResolver::class, 'user_factory' => UserFactory::class, 'user_merchant_factory' => UserMerchantFactory::class, ]); } public function createIndexQueryBuilder( SearchDto $searchDto, EntityDto $entityDto, FieldCollection $fields, FilterCollection $filters ): QueryBuilder { $queryBuilder = parent::createIndexQueryBuilder( $searchDto, $entityDto, $fields, $filters ); //TODO Gérer depuis les événements if ($this->isInstanceOf(FilterMerchantInterface::class)) { $queryBuilder->andWhere('entity.merchant = :merchant'); $queryBuilder->setParameter('merchant', $this->get('merchant_resolver')->getCurrent()); } if ($this->isInstanceOf(FilterMultipleMerchantsInterface::class)) { $queryBuilder->andWhere(':merchant MEMBER OF entity.merchants'); $queryBuilder->setParameter('merchant', $this->get('merchant_resolver')->getCurrent()); } if ($this->isInstanceOf(FilterSectionInterface::class)) { $queryBuilder->andWhere('entity.section = :section'); $queryBuilder->setParameter('section', $this->get('section_resolver')->getCurrent()); } return $queryBuilder; } }