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
magento2-base
dev
tests
setup-integration
_files
Magento
TestSetupDeclarationModule3
revisions
patches_revision
NextChainPatch.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\TestSetupDeclarationModule3\Setup\Patch\Data
;
7
8
use
Magento\Framework\App\ResourceConnection
;
9
use
Magento\Framework\Setup\Patch\DataPatchInterface
;
10
use
Magento\Framework\Setup\Patch\PatchRevertableInterface
;
11
use
Magento\Framework\Setup\Patch\PatchVersionInterface
;
12
16
class
NextChainPatch
implements
17
DataPatchInterface
,
18
PatchRevertableInterface
,
19
PatchVersionInterface
20
{
24
private
$resourceConnection;
25
30
public
function
__construct
(
ResourceConnection
$resourceConnection)
31
{
32
$this->resourceConnection =
$resourceConnection
;
33
}
34
38
public
static
function
getVersion
()
39
{
40
return
'0.0.6'
;
41
}
42
46
public
function
getAliases
()
47
{
48
return
[];
49
}
50
54
public
function
apply
()
55
{
56
$adapter
= $this->resourceConnection->getConnection();
57
$refSelect =
$adapter
->select()->from(
'reference_table'
,
'for_patch_testing'
)
58
->where(
'`tinyint_ref` = ?'
, 7);
59
$varchar2 =
$adapter
->fetchOne($refSelect);
60
$adapter
->update(
61
'reference_table'
,
62
[
'for_patch_testing'
=>
'changed__'
. $varchar2],
63
[
'`tinyint_ref` = ?'
=> 7]
64
);
65
}
66
67
public
function
revert
()
68
{
69
$adapter
= $this->resourceConnection->getConnection();
70
$refSelect =
$adapter
->select()->from(
'reference_table'
,
'for_patch_testing'
)
71
->where(
'`tinyint_ref` = ?'
, 7);
72
$varchar2 =
$adapter
->fetchOne($refSelect);
73
$adapter
->update(
74
'reference_table'
,
75
[
'for_patch_testing'
=> str_replace(
'changed__'
,
''
, $varchar2)],
76
[
'`tinyint_ref` = ?'
=> 7]
77
);
78
}
79
83
public
static
function
getDependencies
()
84
{
85
return
[
86
LlNextChainPatch::class,
87
ZFirstPatch::class
88
];
89
}
90
}
Magento\Framework\Setup\Patch\PatchRevertableInterface
Definition:
PatchRevertableInterface.php:17
Magento\Framework\Setup\Patch\DataPatchInterface
Definition:
DataPatchInterface.php:12
Magento\TestSetupDeclarationModule3\Setup\Patch\Data\NextChainPatch\getVersion
static getVersion()
Definition:
NextChainPatch.php:38
Magento\TestSetupDeclarationModule3\Setup\Patch\Data\NextChainPatch\__construct
__construct(ResourceConnection $resourceConnection)
Definition:
NextChainPatch.php:30
Magento\TestSetupDeclarationModule3\Setup\Patch\Data\NextChainPatch\revert
revert()
Definition:
NextChainPatch.php:67
Magento\TestSetupDeclarationModule3\Setup\Patch\Data\NextChainPatch\apply
apply()
Definition:
NextChainPatch.php:54
Magento\TestSetupDeclarationModule3\Setup\Patch\Data\NextChainPatch
Definition:
NextChainPatch.php:16
$adapter
$adapter
Definition:
webapi_user.php:16
Magento\TestSetupDeclarationModule3\Setup\Patch\Data
Definition:
BicPatch.php:6
Magento\TestSetupDeclarationModule3\Setup\Patch\Data\NextChainPatch\getAliases
getAliases()
Definition:
NextChainPatch.php:46
Magento\TestSetupDeclarationModule3\Setup\Patch\Data\NextChainPatch\getDependencies
static getDependencies()
Definition:
NextChainPatch.php:83
Magento\Framework\Setup\Patch\PatchVersionInterface
Definition:
PatchVersionInterface.php:13
$resourceConnection
$resourceConnection
Definition:
website_attribute_sync.php:32
Magento\Framework\App\ResourceConnection
Definition:
ResourceConnection.php:18
Magento\Framework\App\ResourceConnection