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
integration
testsuite
Magento
Framework
Search
_files
filterable_attributes_rollback.php
Go to the documentation of this file.
1
<?php
7
use
Magento\Catalog\Model\Product
;
8
use
Magento\Catalog\Model\ResourceModel\Eav\Attribute
;
9
use
Magento\Catalog\Setup\CategorySetup
;
10
use
Magento\Framework\Registry
;
11
use
Magento\TestFramework\Helper\Bootstrap
;
12
13
$registry
= Bootstrap::getObjectManager()->get(Registry::class);
14
$registry
->unregister(
'isSecureArea'
);
15
$registry
->register(
'isSecureArea'
,
true
);
17
$productCollection
= Bootstrap::getObjectManager()
18
->create(Product::class)
19
->getCollection();
20
foreach
(
$productCollection
as
$product
) {
21
$product
->delete();
22
}
24
$attribute
= Bootstrap::getObjectManager()->create(
25
Attribute::class
26
);
28
$installer
= Bootstrap::getObjectManager()->create(CategorySetup::class);
29
foreach
(range(1, 2) as
$index
) {
30
$attribute
->loadByCode(
$installer
->getEntityTypeId(
'catalog_product'
),
'select_attribute_'
.
$index
);
31
if
(
$attribute
->getId()) {
32
$attribute
->delete();
33
}
34
}
35
$registry
->unregister(
'isSecureArea'
);
36
$registry
->register(
'isSecureArea'
,
false
);
Magento\TestFramework\Helper\Bootstrap
Definition:
Bootstrap.php:12
Magento\Catalog\Setup\CategorySetup
Definition:
CategorySetup.php:59
Magento\Catalog\Model\Product
Definition:
ActionTest.php:6
$attribute
$attribute
Definition:
filterable_attributes_rollback.php:24
Magento\Catalog\Model\ResourceModel\Eav\Attribute
Definition:
Attribute.php:31
$product
$product
Definition:
bundle_product_with_not_visible_children.php:22
$installer
$installer
Definition:
filterable_attributes_rollback.php:28
Magento\Framework\Registry
Definition:
Registry.php:18
$index
$index
Definition:
list.phtml:44
$registry
$registry
Definition:
filterable_attributes_rollback.php:13
$productCollection
$productCollection
Definition:
filterable_attributes_rollback.php:17