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-quote
Setup
Patch
Data
InstallEntityTypes.php
Go to the documentation of this file.
1
<?php
7
namespace
Magento\Quote\Setup\Patch\Data
;
8
9
use
Magento\Framework\DB\Ddl\Table
;
10
use
Magento\Quote\Setup\QuoteSetup
;
11
use Magento\Quote\Setup\QuoteSetupFactory;
12
use
Magento\Framework\Setup\Patch\DataPatchInterface
;
13
use
Magento\Framework\Setup\Patch\PatchVersionInterface
;
14
15
/***
16
* Class InstallEntityTypes
17
* @package Magento\Quote\Setup\Patch
18
*/
19
class
InstallEntityTypes
implements
DataPatchInterface
,
PatchVersionInterface
20
{
24
private
$moduleDataSetup;
25
29
private
$quoteSetupFactory;
30
36
public
function
__construct
(
37
\
Magento
\Framework\Setup\
ModuleDataSetupInterface
$moduleDataSetup,
38
QuoteSetupFactory $quoteSetupFactory
39
) {
40
$this->moduleDataSetup = $moduleDataSetup;
41
$this->quoteSetupFactory = $quoteSetupFactory;
42
}
43
47
public
function
apply
()
48
{
50
$quoteSetup = $this->quoteSetupFactory->create([
'setup'
=> $this->moduleDataSetup]);
51
55
$attributes
= [
56
'vat_id'
=> [
'type'
=>
Table::TYPE_TEXT
],
57
'vat_is_valid'
=> [
'type'
=>
Table::TYPE_SMALLINT
],
58
'vat_request_id'
=> [
'type'
=>
Table::TYPE_TEXT
],
59
'vat_request_date'
=> [
'type'
=>
Table::TYPE_TEXT
],
60
'vat_request_success'
=> [
'type'
=>
Table::TYPE_SMALLINT
],
61
];
62
foreach
(
$attributes
as
$attributeCode
=> $attributeParams) {
63
$quoteSetup->addAttribute(
'quote_address'
,
$attributeCode
, $attributeParams);
64
}
65
}
66
70
public
static
function
getDependencies
()
71
{
72
return
[];
73
}
74
78
public
static
function
getVersion
()
79
{
80
return
'2.0.0'
;
81
}
82
86
public
function
getAliases
()
87
{
88
return
[];
89
}
90
}
Magento\Quote\Setup\QuoteSetup
Definition:
QuoteSetup.php:21
Magento\Framework\Setup\Patch\DataPatchInterface
Definition:
DataPatchInterface.php:12
Magento\Quote\Setup\Patch\Data\InstallEntityTypes\getAliases
getAliases()
Definition:
InstallEntityTypes.php:86
Magento\Framework\Setup\ModuleDataSetupInterface
Definition:
ModuleDataSetupInterface.php:14
Magento\Framework\DB\Ddl\Table\TYPE_TEXT
const TYPE_TEXT
Definition:
Table.php:43
Magento\Quote\Setup\Patch\Data\InstallEntityTypes
Definition:
InstallEntityTypes.php:19
Magento\Quote\Setup\Patch\Data
Definition:
ConvertSerializedDataToJson.php:7
Magento\Quote\Setup\Patch\Data\InstallEntityTypes\getVersion
static getVersion()
Definition:
InstallEntityTypes.php:78
Magento\Framework\Setup\Patch\PatchInterface\apply
apply()
$attributeCode
$attributeCode
Definition:
extend.phtml:12
Magento\Framework\DB\Ddl\Table
Definition:
Table.php:16
Magento
$attributes
$attributes
Definition:
matrix.phtml:13
Magento\Framework\Setup\Patch\PatchVersionInterface
Definition:
PatchVersionInterface.php:13
Magento\Framework\DB\Ddl\Table\TYPE_SMALLINT
const TYPE_SMALLINT
Definition:
Table.php:23
Magento\Quote\Setup\Patch\Data\InstallEntityTypes\__construct
__construct(\Magento\Framework\Setup\ModuleDataSetupInterface $moduleDataSetup, QuoteSetupFactory $quoteSetupFactory)
Definition:
InstallEntityTypes.php:36
Magento\Quote\Setup\Patch\Data\InstallEntityTypes\getDependencies
static getDependencies()
Definition:
InstallEntityTypes.php:70