Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
module-customer
Setup
Patch
Data
UpdateIdentifierCustomerAttributesVisibility.php
Go to the documentation of this file.
1
<?php
7
namespace
Magento\Customer\Setup\Patch\Data
;
8
9
use Magento\Customer\Setup\CustomerSetupFactory;
10
use
Magento\Framework\App\ResourceConnection
;
11
use
Magento\Framework\Setup\ModuleDataSetupInterface
;
12
use
Magento\Framework\Setup\Patch\DataPatchInterface
;
13
use
Magento\Framework\Setup\Patch\PatchVersionInterface
;
14
19
class
UpdateIdentifierCustomerAttributesVisibility
implements
DataPatchInterface
,
PatchVersionInterface
20
{
24
private
$moduleDataSetup;
25
29
private
$customerSetupFactory;
30
36
public
function
__construct
(
37
ModuleDataSetupInterface
$moduleDataSetup,
38
CustomerSetupFactory $customerSetupFactory
39
) {
40
$this->moduleDataSetup = $moduleDataSetup;
41
$this->customerSetupFactory = $customerSetupFactory;
42
}
43
47
public
function
apply
()
48
{
49
$customerSetup = $this->customerSetupFactory->create([
'setup'
=> $this->moduleDataSetup]);
50
$entityAttributes = [
51
'customer_address'
=> [
52
'region_id'
=> [
53
'is_used_in_grid'
=>
false
,
54
'is_visible_in_grid'
=>
false
,
55
'is_filterable_in_grid'
=>
false
,
56
'is_searchable_in_grid'
=>
false
,
57
],
58
'firstname'
=> [
59
'is_used_in_grid'
=>
true
,
60
'is_visible_in_grid'
=>
false
,
61
'is_filterable_in_grid'
=>
false
,
62
'is_searchable_in_grid'
=>
true
,
63
],
64
'lastname'
=> [
65
'is_used_in_grid'
=>
true
,
66
'is_visible_in_grid'
=>
false
,
67
'is_filterable_in_grid'
=>
false
,
68
'is_searchable_in_grid'
=>
true
,
69
],
70
],
71
];
72
$customerSetup->upgradeAttributes($entityAttributes);
73
}
74
78
public
static
function
getDependencies
()
79
{
80
return
[
81
AddNonSpecifiedGenderAttributeOption::class,
82
];
83
}
84
88
public
static
function
getVersion
()
89
{
90
return
'2.0.3'
;
91
}
92
96
public
function
getAliases
()
97
{
98
return
[];
99
}
100
}
Magento\Framework\Setup\Patch\DataPatchInterface
Definition:
DataPatchInterface.php:12
Magento\Customer\Setup\Patch\Data\UpdateIdentifierCustomerAttributesVisibility\getVersion
static getVersion()
Definition:
UpdateIdentifierCustomerAttributesVisibility.php:88
Magento\Customer\Setup\Patch\Data\UpdateIdentifierCustomerAttributesVisibility\getDependencies
static getDependencies()
Definition:
UpdateIdentifierCustomerAttributesVisibility.php:78
Magento\Framework\Setup\ModuleDataSetupInterface
Definition:
ModuleDataSetupInterface.php:14
Magento\Customer\Setup\Patch\Data
Definition:
AddCustomerUpdatedAtAttribute.php:7
Magento\Customer\Setup\Patch\Data\UpdateIdentifierCustomerAttributesVisibility\getAliases
getAliases()
Definition:
UpdateIdentifierCustomerAttributesVisibility.php:96
Magento\Customer\Setup\Patch\Data\UpdateIdentifierCustomerAttributesVisibility\apply
apply()
Definition:
UpdateIdentifierCustomerAttributesVisibility.php:47
Magento\Framework\Setup\Patch\PatchVersionInterface
Definition:
PatchVersionInterface.php:13
Magento\Customer\Setup\Patch\Data\UpdateIdentifierCustomerAttributesVisibility\__construct
__construct(ModuleDataSetupInterface $moduleDataSetup, CustomerSetupFactory $customerSetupFactory)
Definition:
UpdateIdentifierCustomerAttributesVisibility.php:36
Magento\Customer\Setup\Patch\Data\UpdateIdentifierCustomerAttributesVisibility
Definition:
UpdateIdentifierCustomerAttributesVisibility.php:19
Magento\Framework\App\ResourceConnection