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-configuration
Model
IsSourceItemManagementAllowedForSku.php
Go to the documentation of this file.
1
<?php
6
declare(strict_types=1);
7
8
namespace
Magento\InventoryConfiguration\Model
;
9
10
use
Magento\InventoryConfigurationApi\Model\IsSourceItemManagementAllowedForProductTypeInterface
;
11
use
Magento\InventoryCatalogApi\Model\GetProductTypesBySkusInterface
;
12
use
Magento\InventoryConfigurationApi\Model\IsSourceItemManagementAllowedForSkuInterface
;
13
14
class
IsSourceItemManagementAllowedForSku
implements
IsSourceItemManagementAllowedForSkuInterface
15
{
19
private
$getProductTypesBySkus;
20
24
private
$isSourceItemManagementAllowedForProductType;
25
30
public
function
__construct
(
31
GetProductTypesBySkusInterface
$getProductTypesBySkus,
32
IsSourceItemManagementAllowedForProductTypeInterface
$isSourceItemManagementAllowedForProductType
33
) {
34
$this->getProductTypesBySkus = $getProductTypesBySkus;
35
$this->isSourceItemManagementAllowedForProductType = $isSourceItemManagementAllowedForProductType;
36
}
37
41
public
function
execute
(
string
$sku): bool
42
{
43
$productType = $this->getProductTypesBySkus->execute([$sku]);
44
if
(isset($productType[$sku])) {
45
$typeId = $productType[$sku];
46
}
else
{
47
return
false
;
48
}
49
50
return
$this->isSourceItemManagementAllowedForProductType->execute($typeId);
51
}
52
}
Magento\InventoryConfiguration\Model\IsSourceItemManagementAllowedForSku\__construct
__construct(GetProductTypesBySkusInterface $getProductTypesBySkus, IsSourceItemManagementAllowedForProductTypeInterface $isSourceItemManagementAllowedForProductType)
Definition:
IsSourceItemManagementAllowedForSku.php:30
Magento\InventoryCatalogApi\Model\GetProductTypesBySkusInterface
Definition:
GetProductTypesBySkusInterface.php:15
Magento\InventoryConfiguration\Model\IsSourceItemManagementAllowedForSku\execute
execute(string $sku)
Definition:
IsSourceItemManagementAllowedForSku.php:41
Magento\InventoryConfiguration\Model
Definition:
GetAllowedProductTypesForSourceItemManagement.php:8
Magento\InventoryConfiguration\Model\IsSourceItemManagementAllowedForSku
Definition:
IsSourceItemManagementAllowedForSku.php:14
Magento\InventoryConfigurationApi\Model\IsSourceItemManagementAllowedForProductTypeInterface
Definition:
IsSourceItemManagementAllowedForProductTypeInterface.php:15
Magento\InventoryConfigurationApi\Model\IsSourceItemManagementAllowedForSkuInterface
Definition:
IsSourceItemManagementAllowedForSkuInterface.php:15