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-inventory-indexer
Plugin
InventoryApi
ReindexAfterSourceItemsDeletePlugin.php
Go to the documentation of this file.
1
<?php
6
declare(strict_types=1);
7
8
namespace
Magento\InventoryIndexer\Plugin\InventoryApi
;
9
10
use
Magento\InventoryApi\Api\Data\SourceItemInterface
;
11
use
Magento\InventoryApi\Api\SourceItemsDeleteInterface
;
12
use
Magento\InventoryIndexer\Indexer\Source\SourceIndexer
;
13
17
class
ReindexAfterSourceItemsDeletePlugin
18
{
22
private
$sourceIndexer;
23
27
public
function
__construct
(
SourceIndexer
$sourceIndexer)
28
{
29
$this->sourceIndexer = $sourceIndexer;
30
}
31
39
public
function
aroundExecute
(
40
SourceItemsDeleteInterface
$subject,
41
callable $proceed,
42
array
$sourceItems
43
) {
44
$sourceCodes = [];
45
foreach
(
$sourceItems
as
$sourceItem
) {
46
$sourceCodes[] =
$sourceItem
->getSourceCode();
47
}
48
49
$proceed(
$sourceItems
);
50
51
if
(count($sourceCodes)) {
52
$this->sourceIndexer->executeList($sourceCodes);
53
}
54
}
55
}
Magento\InventoryIndexer\Plugin\InventoryApi\ReindexAfterSourceItemsDeletePlugin\aroundExecute
aroundExecute(SourceItemsDeleteInterface $subject, callable $proceed, array $sourceItems)
Definition:
ReindexAfterSourceItemsDeletePlugin.php:39
Magento\InventoryIndexer\Plugin\InventoryApi\ReindexAfterSourceItemsDeletePlugin
Definition:
ReindexAfterSourceItemsDeletePlugin.php:17
Magento\InventoryApi\Api\Data\SourceItemInterface
Definition:
SourceItemInterface.php:20
$sourceItems
$sourceItems
Definition:
source_items.php:76
Magento\InventoryIndexer\Plugin\InventoryApi
Definition:
InvalidateAfterEnablingOrDisablingSourcePlugin.php:8
Magento\InventoryApi\Api\SourceItemsDeleteInterface
Definition:
SourceItemsDeleteInterface.php:18
Magento\InventoryIndexer\Indexer\Source\SourceIndexer
Definition:
SourceIndexer.php:17
Magento\InventoryIndexer\Plugin\InventoryApi\ReindexAfterSourceItemsDeletePlugin\__construct
__construct(SourceIndexer $sourceIndexer)
Definition:
ReindexAfterSourceItemsDeletePlugin.php:27
$sourceItem
$sourceItem
Definition:
set_product_bundle_out_of_stock.php:24