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
framework
Setup
Declaration
Schema
Operations
DropElement.php
Go to the documentation of this file.
1
<?php
7
namespace
Magento\Framework\Setup\Declaration\Schema\Operations
;
8
9
use Magento\Framework\Setup\Declaration\Schema\Db\AdapterMediator;
10
use
Magento\Framework\Setup\Declaration\Schema\Db\DbSchemaWriterInterface
;
11
use
Magento\Framework\Setup\Declaration\Schema\Db\DefinitionAggregator
;
12
use
Magento\Framework\Setup\Declaration\Schema\Dto\ElementInterface
;
13
use
Magento\Framework\Setup\Declaration\Schema\Dto\TableElementInterface
;
14
use
Magento\Framework\Setup\Declaration\Schema\ElementHistory
;
15
use
Magento\Framework\Setup\Declaration\Schema\OperationInterface
;
16
22
class
DropElement
implements
OperationInterface
23
{
27
const
OPERATION_NAME
=
'drop_element'
;
28
32
private
$dbSchemaWriter;
33
37
private
$definitionAggregator;
38
45
public
function
__construct
(
46
DbSchemaWriterInterface
$dbSchemaWriter,
47
DefinitionAggregator
$definitionAggregator
48
) {
49
$this->dbSchemaWriter = $dbSchemaWriter;
50
$this->definitionAggregator = $definitionAggregator;
51
}
52
56
public
function
getOperationName
()
57
{
58
return
self::OPERATION_NAME
;
59
}
60
64
public
function
isOperationDestructive
()
65
{
66
return
true
;
67
}
68
72
public
function
doOperation
(
ElementHistory
$elementHistory)
73
{
77
$element
= $elementHistory->
getNew
();
78
79
return
[
80
$this->dbSchemaWriter->dropElement(
81
$element
->getTable()->getResource(),
82
$element
->getName(),
83
$element
->getTable()->getName(),
84
$element
->getType()
85
)
86
];
87
}
88
}
Magento\Framework\Setup\Declaration\Schema\ElementHistory\getNew
getNew()
Definition:
ElementHistory.php:55
Magento\Framework\Setup\Declaration\Schema\Operations\DropElement\isOperationDestructive
isOperationDestructive()
Definition:
DropElement.php:64
Magento\Framework\Setup\Declaration\Schema\Db\DbSchemaWriterInterface
Definition:
DbSchemaWriterInterface.php:13
Magento\Framework\Setup\Declaration\Schema\OperationInterface\doOperation
doOperation(ElementHistory $elementHistory)
Magento\Framework\Setup\Declaration\Schema\Operations\DropElement\OPERATION_NAME
const OPERATION_NAME
Definition:
DropElement.php:27
Magento\Framework\Setup\Declaration\Schema\Operations\DropElement\getOperationName
getOperationName()
Definition:
DropElement.php:56
Magento\Framework\Setup\Declaration\Schema\Operations\DropElement
Definition:
DropElement.php:22
Magento\Framework\Setup\Declaration\Schema\ElementHistory
Definition:
ElementHistory.php:16
Magento\Framework\Setup\Declaration\Schema\OperationInterface
Definition:
OperationInterface.php:14
Magento\Framework\Setup\Declaration\Schema\Operations
Definition:
AddColumn.php:7
Magento\Framework\Setup\Declaration\Schema\Dto\ElementInterface
Definition:
ElementInterface.php:15
Magento\Framework\Setup\Declaration\Schema\Operations\DropElement\__construct
__construct(DbSchemaWriterInterface $dbSchemaWriter, DefinitionAggregator $definitionAggregator)
Definition:
DropElement.php:45
Magento\Framework\Setup\Declaration\Schema\Dto\TableElementInterface
Definition:
TableElementInterface.php:13
Magento\Framework\Setup\Declaration\Schema\Db\DefinitionAggregator
Definition:
DefinitionAggregator.php:17
$element
$element
Definition:
element.phtml:12