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
TestSetupDeclarationModule5
revisions
old-scripts
UpgradeData.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\TestSetupDeclarationModule5\Setup
;
7
8
use
Magento\Framework\Setup\ModuleContextInterface
;
9
use
Magento\Framework\Setup\ModuleDataSetupInterface
;
10
use
Magento\Framework\Setup\UpgradeDataInterface
;
11
16
class
UpgradeData
implements
UpgradeDataInterface
17
{
24
public
function
upgrade
(
ModuleDataSetupInterface
$setup
,
ModuleContextInterface
$context)
25
{
26
$adapter
=
$setup
->getConnection();
27
$setup
->startSetup();
28
29
if
(version_compare($context->
getVersion
(),
'1.0.2'
) < 0) {
30
$adapter
->insertArray(
'reference_table'
, [
'some_integer'
], [6, 12, 7]);
31
}
32
33
if
(version_compare($context->
getVersion
(),
'1.0.3'
) < 0) {
34
$adapter
->delete(
'reference_table'
,
'some_integer = 7'
);
35
}
36
37
$setup
->endSetup();
38
}
39
}
Magento\Framework\Setup\ModuleContextInterface\getVersion
getVersion()
Magento\TestSetupDeclarationModule5\Setup\UpgradeData\upgrade
upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
Definition:
UpgradeData.php:24
Magento\Framework\Setup\ModuleContextInterface
Definition:
ModuleContextInterface.php:13
Magento\TestSetupDeclarationModule5\Setup\UpgradeData
Definition:
UpgradeData.php:16
$adapter
$adapter
Definition:
webapi_user.php:16
Magento\Framework\Setup\ModuleDataSetupInterface
Definition:
ModuleDataSetupInterface.php:14
Magento\Framework\Setup\UpgradeDataInterface
Definition:
UpgradeDataInterface.php:14
Magento\TestSetupDeclarationModule5\Setup
Definition:
UpgradeData.php:6
$setup
$setup
Definition:
trigger.php:12