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
date_attribute_rollback.php
Go to the documentation of this file.
1
<?php
7
/* Create attribute */
9
$installer
=
\Magento\TestFramework\Helper\Bootstrap::getObjectManager
()->create(
10
\
Magento
\Catalog\Setup\CategorySetup::class,
11
[
'resourceName'
=>
'catalog_setup'
]
12
);
13
$registry
=
\Magento\TestFramework\Helper\Bootstrap::getObjectManager
()->get(\
Magento
\Framework\Registry::class);
14
15
$registry
->unregister(
'isSecureArea'
);
16
$registry
->register(
'isSecureArea'
,
true
);
17
19
$product
=
\Magento\TestFramework\Helper\Bootstrap::getObjectManager
()->create(\
Magento
\Catalog\Model\Product::class);
20
$product
=
$product
->loadByAttribute(
'sku'
,
'simple_product_with_date_attribute'
);
21
if
(
$product
->getId()) {
22
$product
->delete();
23
}
24
26
$attribute
=
\Magento\TestFramework\Helper\Bootstrap::getObjectManager
()->create(
27
\
Magento
\Catalog\Model\
ResourceModel
\Eav\Attribute::class
28
);
29
$attribute
->loadByCode(
$installer
->getEntityTypeId(
'catalog_product'
),
'date_attribute'
);
30
if
(
$attribute
->getId()) {
31
$attribute
->delete();
32
}
33
34
$registry
->unregister(
'isSecureArea'
);
35
$registry
->register(
'isSecureArea'
,
false
);
Magento\Catalog\Model\ResourceModel\Product
Definition:
CollectionTest.php:6
$attribute
$attribute
Definition:
date_attribute_rollback.php:26
Magento
$registry
$registry
Definition:
date_attribute_rollback.php:13
$installer
$installer
Definition:
date_attribute_rollback.php:9
$product
$product
Definition:
date_attribute_rollback.php:19
Magento\TestFramework\Helper\Bootstrap\getObjectManager
static getObjectManager()
Definition:
Bootstrap.php:125