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
module-catalog
Plugin
Model
AttributeSetRepository
RemoveProducts.php
Go to the documentation of this file.
1
<?php
7
namespace
Magento\Catalog\Plugin\Model\AttributeSetRepository
;
8
9
use
Magento\Catalog\Model\ResourceModel\Product\Collection
;
10
use Magento\Catalog\Model\ResourceModel\Product\CollectionFactory;
11
use
Magento\Eav\Api\AttributeSetRepositoryInterface
;
12
use
Magento\Eav\Api\Data\AttributeSetInterface
;
13
17
class
RemoveProducts
18
{
24
private
$collectionFactory;
25
31
public
function
__construct
(CollectionFactory $collectionFactory)
32
{
33
$this->collectionFactory = $collectionFactory;
34
}
35
46
public
function
afterDelete(
47
AttributeSetRepositoryInterface
$subject,
48
bool
$result
,
49
AttributeSetInterface
$attributeSet
50
) {
52
$productCollection
= $this->collectionFactory->create();
53
$productCollection
->addFieldToFilter(
'attribute_set_id'
, [
'eq'
=>
$attributeSet
->getId()]);
54
$productCollection
->delete();
55
56
return
$result
;
57
}
58
}
Magento\Catalog\Model\ResourceModel\Product\Collection
Definition:
ProductLimitation.php:6
$result
$result
Definition:
product_configurable_not_available_rollback.php:26
Magento\Eav\Api\AttributeSetRepositoryInterface
Definition:
AttributeSetRepositoryInterface.php:14
Magento\Catalog\Plugin\Model\AttributeSetRepository\RemoveProducts\__construct
__construct(CollectionFactory $collectionFactory)
Definition:
RemoveProducts.php:31
Magento\Catalog\Plugin\Model\AttributeSetRepository
Definition:
RemoveProductsTest.php:7
$productCollection
$productCollection
Definition:
configurable_attribute_rollback.php:12
Magento\Eav\Api\Data\AttributeSetInterface
Definition:
AttributeSetInterface.php:13
$attributeSet
$attributeSet
Definition:
attribute_set_with_image_attribute.php:11
Magento\Catalog\Plugin\Model\AttributeSetRepository\RemoveProducts
Definition:
RemoveProducts.php:17