17 use Magento\Customer\Api\Data\GroupInterfaceFactory;
18 use Magento\Customer\Model\GroupFactory;
101 $group = $this->groupFactory->create();
103 if (
$group->getId() ===
null) {
106 return $groupId == self::NOT_LOGGED_IN_ID ||
$group->usesAsDefault();
115 $storeId = $this->storeManager->getStore()->getCode();
118 $groupId = $this->scopeConfig->getValue(
119 self::XML_PATH_DEFAULT_ID,
123 }
catch (\
Magento\Framework\Exception\State\InitException $e) {
129 return $this->groupRepository->getById(
$groupId);
140 return $this->groupRepository->getById(self::NOT_LOGGED_IN_ID);
148 $notLoggedInFilter[] = $this->filterBuilder
150 ->setConditionType(
'neq')
151 ->setValue(self::NOT_LOGGED_IN_ID)
153 $groupAll[] = $this->filterBuilder
155 ->setConditionType(
'neq')
156 ->setValue(self::CUST_GROUP_ALL)
159 ->addFilters($notLoggedInFilter)
160 ->addFilters($groupAll)
static doubleField($fieldName, $fieldValue, $secondFieldName, $secondFieldValue)
const XML_PATH_DEFAULT_ID
const GROUP_CODE_MAX_LENGTH
static singleField($fieldName, $fieldValue)
__construct(StoreManagerInterface $storeManager, ScopeConfigInterface $scopeConfig, GroupFactory $groupFactory, GroupRepositoryInterface $groupRepository, GroupInterfaceFactory $groupDataFactory, SearchCriteriaBuilder $searchCriteriaBuilder, FilterBuilder $filterBuilder)
getDefaultGroup($storeId=null)