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
Model
ResourceModel
GetSourceCodesBySkus.php
Go to the documentation of this file.
1
<?php
6
declare(strict_types=1);
7
8
namespace
Magento\Inventory\Model\ResourceModel
;
9
10
use
Magento\Framework\App\ResourceConnection
;
11
15
class
GetSourceCodesBySkus
16
{
20
private
$resourceConnection;
21
25
public
function
__construct
(
26
ResourceConnection
$resourceConnection
27
) {
28
$this->resourceConnection =
$resourceConnection
;
29
}
30
35
public
function
execute
(array
$skus
): array
36
{
37
$tableName
= $this->resourceConnection->getTableName(
SourceItem::TABLE_NAME_SOURCE_ITEM
);
38
$connection
= $this->resourceConnection->getConnection();
39
40
$qry =
$connection
41
->select()
42
->distinct()
43
->from(
$tableName
,
'source_code'
)
44
->where(
'sku IN (?)'
,
$skus
);
45
46
return
$connection
->fetchCol($qry);
47
}
48
}
Magento\Inventory\Model\ResourceModel\GetSourceCodesBySkus
Definition:
GetSourceCodesBySkus.php:15
$tableName
$tableName
Definition:
trigger.php:13
Magento\Inventory\Model\ResourceModel\GetSourceCodesBySkus\__construct
__construct(ResourceConnection $resourceConnection)
Definition:
GetSourceCodesBySkus.php:25
$skus
foreach($websiteCodes as $websiteCode) $skus
Definition:
assign_products_to_websites.php:23
Magento\Inventory\Model\ResourceModel\SourceItem\TABLE_NAME_SOURCE_ITEM
const TABLE_NAME_SOURCE_ITEM
Definition:
SourceItem.php:20
Magento\Inventory\Model\ResourceModel\GetSourceCodesBySkus\execute
execute(array $skus)
Definition:
GetSourceCodesBySkus.php:35
Magento\Inventory\Model\ResourceModel
Definition:
GetSourceCodesBySkus.php:8
$resourceConnection
$resourceConnection
Definition:
website_attribute_sync.php:32
Magento\Framework\App\ResourceConnection
Definition:
ResourceConnection.php:18
$connection
$connection
Definition:
bulk.php:13
Magento\Framework\App\ResourceConnection