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
UpdateVATNumber.php
Go to the documentation of this file.
1
<?php
7
namespace
Magento\Customer\Setup\Patch\Data
;
8
9
use
Magento\Customer\Model\Customer
;
10
use Magento\Customer\Setup\CustomerSetupFactory;
11
use
Magento\Directory\Model\AllowedCountries
;
12
use
Magento\Framework\App\ObjectManager
;
13
use
Magento\Framework\Encryption\Encryptor
;
14
use
Magento\Framework\Indexer\IndexerRegistry
;
15
use
Magento\Framework\Setup\SetupInterface
;
16
use
Magento\Framework\Setup\UpgradeDataInterface
;
17
use
Magento\Framework\Setup\ModuleContextInterface
;
18
use
Magento\Framework\Setup\ModuleDataSetupInterface
;
19
use
Magento\Store\Model\ScopeInterface
;
20
use
Magento\Store\Model\StoreManagerInterface
;
21
use
Magento\Framework\DB\FieldDataConverterFactory
;
22
use
Magento\Framework\DB\DataConverter\SerializedToJson
;
23
use
Magento\Framework\App\ResourceConnection
;
24
use
Magento\Framework\Setup\Patch\DataPatchInterface
;
25
use
Magento\Framework\Setup\Patch\PatchVersionInterface
;
26
27
class
UpdateVATNumber
implements
DataPatchInterface
,
PatchVersionInterface
28
{
32
private
$moduleDataSetup;
33
37
private
$customerSetupFactory;
38
44
public
function
__construct
(
45
ModuleDataSetupInterface
$moduleDataSetup,
46
CustomerSetupFactory $customerSetupFactory
47
) {
48
$this->moduleDataSetup = $moduleDataSetup;
49
$this->customerSetupFactory = $customerSetupFactory;
50
}
51
55
public
function
apply
()
56
{
57
$customerSetup = $this->customerSetupFactory->create([
'resourceConnection'
=> $this->moduleDataSetup]);
58
$customerSetup->updateAttribute(
'customer_address'
,
'vat_id'
,
'frontend_label'
,
'VAT Number'
);
59
}
60
64
public
static
function
getDependencies
()
65
{
66
return
[
67
ConvertValidationRulesFromSerializedToJson::class,
68
];
69
}
70
74
public
static
function
getVersion
()
75
{
76
return
'2.0.12'
;
77
}
78
82
public
function
getAliases
()
83
{
84
return
[];
85
}
86
}
Magento\Customer\Setup\Patch\Data\UpdateVATNumber\__construct
__construct(ModuleDataSetupInterface $moduleDataSetup, CustomerSetupFactory $customerSetupFactory)
Definition:
UpdateVATNumber.php:44
Magento\Framework\Encryption\Encryptor
Definition:
Encryptor.php:21
Magento\Customer\Setup\Patch\Data\UpdateVATNumber\getVersion
static getVersion()
Definition:
UpdateVATNumber.php:74
Magento\Framework\Setup\Patch\DataPatchInterface
Definition:
DataPatchInterface.php:12
Magento\Framework\DB\FieldDataConverterFactory
Definition:
FieldDataConverterFactory.php:13
Magento\Framework\DB\DataConverter\SerializedToJson
Definition:
SerializedToJson.php:14
Magento\Customer\Setup\Patch\Data\UpdateVATNumber\getAliases
getAliases()
Definition:
UpdateVATNumber.php:82
Magento\Customer\Setup\Patch\Data\UpdateVATNumber
Definition:
UpdateVATNumber.php:27
Magento\Framework\Setup\ModuleContextInterface
Definition:
ModuleContextInterface.php:13
Magento\Framework\Setup\SetupInterface
Definition:
SetupInterface.php:14
Magento\Customer\Setup\Patch\Data\UpdateVATNumber\getDependencies
static getDependencies()
Definition:
UpdateVATNumber.php:64
Magento\Framework\App\ObjectManager
Definition:
ConfigCache.php:8
Magento\Customer\Setup\Patch\Data\UpdateVATNumber\apply
apply()
Definition:
UpdateVATNumber.php:55
Magento\Framework\Setup\ModuleDataSetupInterface
Definition:
ModuleDataSetupInterface.php:14
Magento\Store\Model\StoreManagerInterface
Definition:
StoreManagerInterface.php:17
Magento\Store\Model\ScopeInterface
Definition:
ScopeInterface.php:12
Magento\Customer\Setup\Patch\Data
Definition:
AddCustomerUpdatedAtAttribute.php:7
Magento\Directory\Model\AllowedCountries
Definition:
AllowedCountries.php:19
Magento\Framework\Setup\UpgradeDataInterface
Definition:
UpgradeDataInterface.php:14
Magento\Customer\Model\Customer
Magento\Framework\Setup\Patch\PatchVersionInterface
Definition:
PatchVersionInterface.php:13
Magento\Framework\Indexer\IndexerRegistry
Definition:
IndexerRegistry.php:12
Magento\Framework\App\ResourceConnection