em = $em ; $this->sectionRepository = $this->em->getRepository($this->em->getClassMetadata(SectionInterface::class)->getName()) ; $this->merchantUtils = $merchantUtils ; } public function getSection($devAlias) { $section = $this->sectionRepository->findOneBy([ 'merchant' => $this->merchantUtils->getMerchantCurrent(), 'devAlias' => $devAlias ]) ; if(!$section) { throw new NotFoundException('La section '.$devAlias.' est introuvable') ; } return $section ; } }