15 use Magento\Eav\Model\ResourceModel\Entity\Attribute\Group\CollectionFactory;
43 CollectionFactory $attrGroupCollectionFactory,
47 parent::__construct(
$setup, $context,
$cache, $attrGroupCollectionFactory);
59 $customer = (int)parent::getEntityTypeId(
'customer');
64 [
'ea' => $this->
getSetup()->getTable(
'eav_attribute')],
65 [
'entity_type_id',
'attribute_code',
'attribute_id']
67 'ea.entity_type_id IN(?)',
71 $attributeIds[
$row[
'entity_type_id']][
$row[
'attribute_code']] =
$row[
'attribute_id'];
82 $usedInForms = [
'customer_account_create',
'customer_account_edit',
'checkout_register'];
84 $usedInForms = [
'adminhtml_customer'];
86 $usedInForms[] =
'adminhtml_customer';
89 $usedInForms[] =
'adminhtml_checkout';
91 foreach ($usedInForms as $formCode) {
92 $data[] = [
'form_code' => $formCode,
'attribute_id' => $attributeId];
97 $attributes = $entities[
'customer_address'][
'attributes'];
104 'adminhtml_customer_address',
105 'customer_address_edit',
106 'customer_register_address',
108 foreach ($usedInForms as $formCode) {
109 $data[] = [
'form_code' => $formCode,
'attribute_id' => $attributeId];
116 ->insertMultiple($this->
getSetup()->getTable(
'customer_form_attribute'),
$data);
131 'entity_model' => \Magento\Customer\Model\ResourceModel\Customer::class,
132 'attribute_model' => \Magento\Customer\Model\Attribute::class,
133 'table' =>
'customer_entity',
134 'increment_model' => \Magento\Eav\Model\Entity\Increment\NumericValue::class,
135 'additional_attribute_table' =>
'customer_eav_attribute',
136 'entity_attribute_collection' => \Magento\Customer\Model\ResourceModel\Attribute\Collection::class,
140 'label' =>
'Associate to Website',
142 'source' => \Magento\Customer\Model\Customer\Attribute\Source\Website::class,
143 'backend' => \Magento\Customer\Model\Customer\Attribute\Backend\Website::class,
146 'adminhtml_only' => 1,
150 'label' =>
'Create In',
152 'source' => \Magento\Customer\Model\Customer\Attribute\Source\Store::class,
153 'backend' => \Magento\Customer\Model\Customer\Attribute\Backend\Store::class,
156 'adminhtml_only' => 1,
160 'label' =>
'Created From',
165 'adminhtml_only' => 1,
169 'label' =>
'Name Prefix',
179 'label' =>
'First Name',
182 'validate_rules' =>
'{"max_text_length":255,"min_text_length":1}',
187 'label' =>
'Middle Name/Initial',
197 'label' =>
'Last Name',
200 'validate_rules' =>
'{"max_text_length":255,"min_text_length":1}',
205 'label' =>
'Name Suffix',
218 'validate_rules' =>
'{"input_validation":"email"}',
220 'admin_checkout' => 1,
226 'source' => \Magento\Customer\Model\Customer\Attribute\Source\Group::class,
229 'adminhtml_only' => 1,
230 'admin_checkout' => 1,
234 'label' =>
'Date of Birth',
236 'frontend' => \Magento\Eav\Model\Entity\Attribute\Frontend\Datetime::class,
237 'backend' => \Magento\Eav\Model\Entity\Attribute\Backend\Datetime::class,
242 'input_filter' =>
'date',
243 'validate_rules' =>
'{"input_validation":"date"}',
245 'admin_checkout' => 1,
250 'backend' => \Magento\Customer\Model\Customer\Attribute\Backend\Password::class,
262 'rp_token_created_at' => [
265 'validate_rules' =>
'{"input_validation":"date"}',
270 'default_billing' => [
272 'label' =>
'Default Billing Address',
274 'backend' => \Magento\Customer\Model\Customer\Attribute\Backend\Billing::class,
279 'default_shipping' => [
281 'label' =>
'Default Shipping Address',
283 'backend' => \Magento\Customer\Model\Customer\Attribute\Backend\Shipping::class,
290 'label' =>
'Tax/VAT Number',
296 'validate_rules' =>
'{"max_text_length":255}',
298 'admin_checkout' => 1,
302 'label' =>
'Is Confirmed',
310 'label' =>
'Created At',
321 'source' => \Magento\Eav\Model\Entity\Attribute\Source\Table::class,
326 'validate_rules' =>
'[]',
328 'admin_checkout' => 1,
329 'option' => [
'values' => [
'Male',
'Female']],
331 'disable_auto_group_change' => [
333 'label' =>
'Disable Automatic Group Change Based on VAT ID',
334 'input' =>
'boolean',
335 'backend' => \Magento\Customer\Model\Attribute\Backend\Data\Boolean::class,
338 'adminhtml_only' => true
342 'customer_address' => [
344 'entity_model' => \Magento\Customer\Model\ResourceModel\Address::class,
345 'attribute_model' => \Magento\Customer\Model\Attribute::class,
346 'table' =>
'customer_address_entity',
347 'additional_attribute_table' =>
'customer_eav_attribute',
348 'entity_attribute_collection' =>
349 \Magento\Customer\Model\ResourceModel\Address\Attribute\Collection::class,
353 'label' =>
'Name Prefix',
363 'label' =>
'First Name',
366 'validate_rules' =>
'{"max_text_length":255,"min_text_length":1}',
371 'label' =>
'Middle Name/Initial',
381 'label' =>
'Last Name',
384 'validate_rules' =>
'{"max_text_length":255,"min_text_length":1}',
389 'label' =>
'Name Suffix',
399 'label' =>
'Company',
403 'validate_rules' =>
'{"max_text_length":255,"min_text_length":1}',
408 'label' =>
'Street Address',
409 'input' =>
'multiline',
410 'backend' => \Magento\Eav\Model\Entity\Attribute\Backend\DefaultBackend::class,
412 'multiline_count' => 2,
413 'validate_rules' =>
'{"max_text_length":255,"min_text_length":1}',
421 'validate_rules' =>
'{"max_text_length":255,"min_text_length":1}',
426 'label' =>
'Country',
428 'source' => \Magento\Customer\Model\ResourceModel\Address\Attribute\Source\Country::class,
434 'label' =>
'State/Province',
436 'backend' => \Magento\Customer\Model\ResourceModel\Address\Attribute\Backend\Region::class,
443 'label' =>
'State/Province',
445 'source' => \Magento\Customer\Model\ResourceModel\Address\Attribute\Source\Region::class,
452 'label' =>
'Zip/Postal Code',
455 'validate_rules' =>
'[]',
456 'data' => \Magento\Customer\Model\Attribute\Data\Postcode::class,
462 'label' =>
'Phone Number',
465 'validate_rules' =>
'{"max_text_length":255,"min_text_length":1}',
474 'validate_rules' =>
'{"max_text_length":255,"min_text_length":1}',
__construct(ModuleDataSetupInterface $setup, Context $context, CacheInterface $cache, CollectionFactory $attrGroupCollectionFactory, Config $eavConfig)
upgradeAttributes(array $entityAttributes)