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
Indexer
Stock
GetAllStockIds.php
Go to the documentation of this file.
1
<?php
6
declare(strict_types=1);
7
8
namespace
Magento\InventoryIndexer\Indexer\Stock
;
9
10
use
Magento\Framework\App\ResourceConnection
;
11
use
Magento\Inventory\Model\ResourceModel\Stock
as
StockResourceModel
;
12
use
Magento\Inventory\Model\StockSourceLink
;
13
17
class
GetAllStockIds
18
{
22
private
$resourceConnection;
23
27
public
function
__construct
(
ResourceConnection
$resourceConnection)
28
{
29
$this->resourceConnection =
$resourceConnection
;
30
}
31
35
public
function
execute
(): array
36
{
37
$connection
= $this->resourceConnection->getConnection();
38
$stockTable = $this->resourceConnection->getTableName(StockResourceModel::TABLE_NAME_STOCK);
39
40
$select
=
$connection
->select()->from($stockTable,
StockSourceLink::STOCK_ID
);
41
42
$stockIds
=
$connection
->fetchCol(
$select
);
43
$stockIds
= array_map(
'intval'
,
$stockIds
);
44
45
return
$stockIds
;
46
}
47
}
Magento\Inventory\Model\StockSourceLink
Magento\InventoryIndexer\Indexer\Stock
Definition:
GetAllStockIds.php:8
$select
$select
Definition:
catalog_rule_10_off_not_logged_rollback.php:14
Magento\InventoryIndexer\Indexer\Stock\GetAllStockIds\execute
execute()
Definition:
GetAllStockIds.php:35
Magento\Inventory\Model\ResourceModel\Stock
Definition:
Collection.php:8
Magento\InventoryIndexer\Indexer\Stock\GetAllStockIds
Definition:
GetAllStockIds.php:17
Magento\InventoryApi\Api\Data\StockSourceLinkInterface\STOCK_ID
const STOCK_ID
Definition:
StockSourceLinkInterface.php:22
$resourceConnection
$resourceConnection
Definition:
website_attribute_sync.php:32
Magento\Framework\App\ResourceConnection
Definition:
ResourceConnection.php:18
$stockIds
$stockIds
Definition:
reindex_inventory_rollback.php:19
Magento\InventoryIndexer\Indexer\Stock\GetAllStockIds\__construct
__construct(ResourceConnection $resourceConnection)
Definition:
GetAllStockIds.php:27
$connection
$connection
Definition:
bulk.php:13
Magento\Framework\App\ResourceConnection