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
ReindexAfterSourceItemsSavePlugin.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\SourceItemsSaveInterface
;
12
use
Magento\InventoryIndexer\Indexer\SourceItem\GetSourceItemIds
;
13
use
Magento\InventoryIndexer\Indexer\SourceItem\SourceItemIndexer
;
14
18
class
ReindexAfterSourceItemsSavePlugin
19
{
23
private
$getSourceItemIds;
24
28
private
$sourceItemIndexer;
29
34
public
function
__construct
(
GetSourceItemIds
$getSourceItemIds,
SourceItemIndexer
$sourceItemIndexer)
35
{
36
$this->getSourceItemIds = $getSourceItemIds;
37
$this->sourceItemIndexer = $sourceItemIndexer;
38
}
39
47
public
function
afterExecute
(
48
SourceItemsSaveInterface
$subject,
49
$result
,
50
array
$sourceItems
51
) {
52
$sourceItemIds = $this->getSourceItemIds->execute(
$sourceItems
);
53
if
(count($sourceItemIds)) {
54
$this->sourceItemIndexer->executeList($sourceItemIds);
55
}
56
}
57
}
$result
$result
Definition:
product_configurable_not_available_rollback.php:26
Magento\InventoryIndexer\Plugin\InventoryApi\ReindexAfterSourceItemsSavePlugin\__construct
__construct(GetSourceItemIds $getSourceItemIds, SourceItemIndexer $sourceItemIndexer)
Definition:
ReindexAfterSourceItemsSavePlugin.php:34
Magento\InventoryApi\Api\SourceItemsSaveInterface
Definition:
SourceItemsSaveInterface.php:18
Magento\InventoryIndexer\Indexer\SourceItem\GetSourceItemIds
Definition:
GetSourceItemIds.php:17
Magento\InventoryIndexer\Indexer\SourceItem\SourceItemIndexer
Definition:
SourceItemIndexer.php:24
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\InventoryIndexer\Plugin\InventoryApi\ReindexAfterSourceItemsSavePlugin
Definition:
ReindexAfterSourceItemsSavePlugin.php:18
Magento\InventoryIndexer\Plugin\InventoryApi\ReindexAfterSourceItemsSavePlugin\afterExecute
afterExecute(SourceItemsSaveInterface $subject, $result, array $sourceItems)
Definition:
ReindexAfterSourceItemsSavePlugin.php:47