Definition at line 14 of file CustomerExtractor.php.
◆ __construct()
- Parameters
-
Metadata\FormFactory | $formFactory | |
\Magento\Customer\Api\Data\CustomerInterfaceFactory | $customerFactory | |
\Magento\Store\Model\StoreManagerInterface | $storeManager | |
GroupManagementInterface | $customerGroupManagement | |
\Magento\Framework\Api\DataObjectHelper | $dataObjectHelper | |
Definition at line 48 of file CustomerExtractor.php.
◆ extract()
- Parameters
-
string | $formCode | |
RequestInterface | $request | |
array | $attributeValues | |
- Returns
- CustomerInterface
Definition at line 68 of file CustomerExtractor.php.
73 $customerForm = $this->formFactory->create(
82 $allowedAttributes = $customerForm->getAllowedAttributes();
83 $isGroupIdEmpty = isset($allowedAttributes[
'group_id']);
85 $customerDataObject = $this->customerFactory->create();
86 $this->dataObjectHelper->populateWithArray(
89 \
Magento\Customer\Api\Data\CustomerInterface::class
91 $store = $this->storeManager->getStore();
92 if ($isGroupIdEmpty) {
93 $customerDataObject->setGroupId(
94 $this->customerGroupManagement->getDefaultGroup(
$store->getId())->getId()
98 $customerDataObject->setWebsiteId(
$store->getWebsiteId());
99 $customerDataObject->setStoreId(
$store->getId());
101 return $customerDataObject;
◆ $customerFactory
◆ $customerGroupManagement
◆ $dataObjectHelper
◆ $formFactory
◆ $storeManager
The documentation for this class was generated from the following file: