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
IncrementalSomeIntegerPatch.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
17
class
IncrementalSomeIntegerPatch
implements
18
DataPatchInterface
,
19
PatchRevertableInterface
,
20
PatchVersionInterface
21
{
25
private
$resourceConnection;
26
31
public
function
__construct
(
ResourceConnection
$resourceConnection)
32
{
33
$this->resourceConnection =
$resourceConnection
;
34
}
35
39
public
static
function
getVersion
()
40
{
41
return
'1.0.5'
;
42
}
43
47
public
function
getAliases
()
48
{
49
return
[];
50
}
51
55
public
function
apply
()
56
{
57
$adapter
= $this->resourceConnection->getConnection();
58
$select
=
$adapter
->select()->from(
'test_table'
,
'varchar'
)
59
->where(
'`smallint` = ?'
, 1);
60
$refSelect =
$adapter
->select()->from(
'reference_table'
,
'for_patch_testing'
)
61
->where(
'`tinyint_ref` = ?'
, 7);
62
$varchar =
$adapter
->fetchOne(
$select
);
63
$varchar2 =
$adapter
->fetchOne($refSelect);
64
$adapter
->insert(
'test_table'
, [
'varchar'
=> $varchar .
"_ref"
,
'varbinary'
=> 0101010]);
65
$adapter
->insert(
'test_table'
, [
'varchar'
=> $varchar2,
'varbinary'
=> 0]);
66
}
67
68
public
function
revert
()
69
{
70
$adapter
= $this->resourceConnection->getConnection();
71
$select
=
$adapter
->select()->from(
'test_table'
,
'varchar'
)
72
->where(
'`smallint` = ?'
, 1);
73
$varchar =
$adapter
->fetchOne(
$select
);
74
$refSelect =
$adapter
->select()->from(
'reference_table'
,
'for_patch_testing'
)
75
->where(
'`tinyint_ref` = ?'
, 7);
76
$varchar2 =
$adapter
->fetchOne($refSelect);
77
$adapter
->delete(
'test_table'
, [
'`varchar` = ?'
=> $varchar .
"_ref"
]);
78
$adapter
->delete(
'test_table'
, [
'`varchar` = ?'
=> $varchar2]);
79
}
80
84
public
static
function
getDependencies
()
85
{
86
return
[
87
ReferenceIncrementalSomeIntegerPatch::class,
88
NextChainPatch::class
89
];
90
}
91
}
Magento\TestSetupDeclarationModule3\Setup\Patch\Data\IncrementalSomeIntegerPatch\revert
revert()
Definition:
IncrementalSomeIntegerPatch.php:68
Magento\Framework\Setup\Patch\PatchRevertableInterface
Definition:
PatchRevertableInterface.php:17
Magento\Framework\Setup\Patch\DataPatchInterface
Definition:
DataPatchInterface.php:12
$adapter
$adapter
Definition:
webapi_user.php:16
$select
$select
Definition:
catalog_rule_10_off_not_logged_rollback.php:14
Magento\TestSetupDeclarationModule3\Setup\Patch\Data
Definition:
BicPatch.php:6
Magento\TestSetupDeclarationModule3\Setup\Patch\Data\IncrementalSomeIntegerPatch\__construct
__construct(ResourceConnection $resourceConnection)
Definition:
IncrementalSomeIntegerPatch.php:31
Magento\Framework\Setup\Patch\PatchVersionInterface
Definition:
PatchVersionInterface.php:13
Magento\TestSetupDeclarationModule3\Setup\Patch\Data\IncrementalSomeIntegerPatch\apply
apply()
Definition:
IncrementalSomeIntegerPatch.php:55
Magento\TestSetupDeclarationModule3\Setup\Patch\Data\IncrementalSomeIntegerPatch\getAliases
getAliases()
Definition:
IncrementalSomeIntegerPatch.php:47
$resourceConnection
$resourceConnection
Definition:
website_attribute_sync.php:32
Magento\TestSetupDeclarationModule3\Setup\Patch\Data\IncrementalSomeIntegerPatch\getDependencies
static getDependencies()
Definition:
IncrementalSomeIntegerPatch.php:84
Magento\Framework\App\ResourceConnection
Definition:
ResourceConnection.php:18
Magento\Framework\App\ResourceConnection
Magento\TestSetupDeclarationModule3\Setup\Patch\Data\IncrementalSomeIntegerPatch\getVersion
static getVersion()
Definition:
IncrementalSomeIntegerPatch.php:39
Magento\TestSetupDeclarationModule3\Setup\Patch\Data\IncrementalSomeIntegerPatch
Definition:
IncrementalSomeIntegerPatch.php:17