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
Test
Integration
Indexer
RemoveIndexData.php
Go to the documentation of this file.
1
<?php
6
declare(strict_types=1);
7
8
namespace
Magento\InventoryIndexer\Test\Integration\Indexer
;
9
10
use
Magento\Framework\App\ResourceConnection
;
11
use
Magento\InventoryMultiDimensionalIndexerApi\Model\Alias
;
12
use
Magento\InventoryMultiDimensionalIndexerApi\Model\IndexNameBuilder
;
13
use
Magento\InventoryIndexer\Indexer\IndexStructure
;
14
use
Magento\InventoryIndexer\Indexer\InventoryIndexer
;
15
16
class
RemoveIndexData
17
{
21
private
$indexNameBuilder;
22
26
private
$indexStructure;
27
32
public
function
__construct
(
33
IndexNameBuilder
$indexNameBuilder,
34
IndexStructure
$indexStructure
35
) {
36
$this->indexNameBuilder = $indexNameBuilder;
37
$this->indexStructure = $indexStructure;
38
}
39
44
public
function
execute
(array
$stockIds
)
45
{
46
foreach
(
$stockIds
as $stockId) {
47
$indexName = $this->indexNameBuilder
48
->setIndexId(
InventoryIndexer::INDEXER_ID
)
49
->addDimension(
'stock_'
, (
string
)$stockId)
50
->setAlias(
Alias::ALIAS_MAIN
)
51
->build();
52
$this->indexStructure->delete($indexName,
ResourceConnection::DEFAULT_CONNECTION
);
53
}
54
}
55
}
Magento\InventoryIndexer\Test\Integration\Indexer\RemoveIndexData\execute
execute(array $stockIds)
Definition:
RemoveIndexData.php:44
Magento\InventoryMultiDimensionalIndexerApi\Model\IndexNameBuilder
Definition:
IndexNameBuilder.php:17
Magento\Framework\App\ResourceConnection\DEFAULT_CONNECTION
const DEFAULT_CONNECTION
Definition:
ResourceConnection.php:26
Magento\InventoryMultiDimensionalIndexerApi\Model\Alias\ALIAS_MAIN
const ALIAS_MAIN
Definition:
Alias.php:28
Magento\InventoryIndexer\Test\Integration\Indexer\RemoveIndexData\__construct
__construct(IndexNameBuilder $indexNameBuilder, IndexStructure $indexStructure)
Definition:
RemoveIndexData.php:32
Magento\InventoryIndexer\Indexer\IndexStructure
Definition:
IndexStructure.php:20
Magento\InventoryIndexer\Indexer\InventoryIndexer
Definition:
InventoryIndexer.php:18
Magento\InventoryIndexer\Indexer\InventoryIndexer\INDEXER_ID
const INDEXER_ID
Definition:
InventoryIndexer.php:23
$stockIds
$stockIds
Definition:
reindex_inventory_rollback.php:19
Magento\InventoryMultiDimensionalIndexerApi\Model\Alias
Definition:
Alias.php:18
Magento\InventoryIndexer\Test\Integration\Indexer\RemoveIndexData
Definition:
RemoveIndexData.php:16
Magento\Framework\App\ResourceConnection
Magento\InventoryIndexer\Test\Integration\Indexer
Definition:
RemoveIndexData.php:8