|
|
@@ -47,7 +47,7 @@ class SectionResolver |
|
|
|
$this->urlResolver = $urlResolver; |
|
|
|
} |
|
|
|
|
|
|
|
public function getCurrent($returnDefaultIfOutOfSections = false, $returnVisitedIfOutOfSection = false) |
|
|
|
public function getCurrent($returnDefaultIfOutOfSections = false, $returnVisitedIfOutOfSection = false, $throwExceptionIfSectionNotFound = true) |
|
|
|
{ |
|
|
|
$requestAttributesArray = $this->requestStack->getMainRequest()->attributes->all(); |
|
|
|
|
|
|
@@ -95,7 +95,8 @@ class SectionResolver |
|
|
|
$sectionCurrent = $sectionStore |
|
|
|
->setMerchant($merchantCurrent) |
|
|
|
->getOneBySlug($requestAttributesArray['section']); |
|
|
|
if($sectionCurrent===null){ |
|
|
|
|
|
|
|
if($sectionCurrent === null && $throwExceptionIfSectionNotFound){ |
|
|
|
throw new NotFoundHttpException('Aucun espace n\'a été trouvé'); |
|
|
|
} |
|
|
|
} |
|
|
@@ -117,7 +118,7 @@ class SectionResolver |
|
|
|
|
|
|
|
public function isOutOfSection(): bool |
|
|
|
{ |
|
|
|
return $this->getCurrent() == null; |
|
|
|
return $this->getCurrent(false, false, false) == null; |
|
|
|
} |
|
|
|
|
|
|
|
public function getDefault(): SectionInterface |