You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
- <?php
-
- namespace Lc\CaracoleBundle\Repository\Section;
-
- use Lc\CaracoleBundle\Model\Section\SectionInterface;
- use Lc\CaracoleBundle\Repository\MerchantStoreTrait;
- use Lc\SovBundle\Repository\AbstractStore;
- use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
-
- class SectionStore extends AbstractStore
- {
- use MerchantStoreTrait;
-
- protected SectionRepositoryQuery $query;
-
- public function __construct(SectionRepositoryQuery $query)
- {
- $this->query = $query;
- }
-
- // getSection
- public function getOneByDevAlias(string $devAlias): ?SectionInterface
- {
- $query = $this->query->create();
-
- $query
- ->filterByMerchant($this->merchant)
- ->filterByDevAlias($devAlias);
-
- $section = $query->findOne();
-
- if (!$section) {
- throw new NotFoundHttpException('La section ' . $devAlias . ' est introuvable');
- }
-
- return $section;
- }
- }
|