瀏覽代碼

Section resolver exepction

feature/ticket
Fab 3 年之前
父節點
當前提交
52ec4952e6
共有 1 個檔案被更改,包括 7 行新增3 行删除
  1. +7
    -3
      Resolver/SectionResolver.php

+ 7
- 3
Resolver/SectionResolver.php 查看文件

@@ -29,13 +29,17 @@ class SectionResolver
$currentAdminSection = null;
$userMerchant = $this->merchantResolver->getUserMerchant();

if($userMerchant!==null){
if ($userMerchant !== null) {
$currentAdminSection = $userMerchant->getCurrentAdminSection();
}

if($currentAdminSection === null){
$currentAdminSection = $this->sectionRepository->findOneBy(array('isDefault'=>true));
if ($currentAdminSection === null) {
$currentAdminSection = $this->sectionRepository->findOneBy(array('isDefault' => true));
if ($currentAdminSection === null) {
throw new \ErrorException('Aucune section par défaut définie pour ce merchant');
}
}

return $currentAdminSection;
}


Loading…
取消
儲存