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-low-quantity-notification
Model
SourceItemConfiguration
SaveMultiple.php
Go to the documentation of this file.
1
<?php
6
declare(strict_types=1);
7
8
namespace
Magento\InventoryLowQuantityNotification\Model\SourceItemConfiguration
;
9
10
use
Magento\Framework\Exception\CouldNotSaveException
;
11
use
Magento\Framework\Exception\InputException
;
12
use
Magento\InventoryLowQuantityNotification\Model\ResourceModel\SourceItemConfiguration\SaveMultiple
13
as SaveMultipleResourceModel;
14
use
Magento\InventoryLowQuantityNotificationApi\Api\SourceItemConfigurationsSaveInterface
;
15
use Psr\Log\LoggerInterface;
16
20
class
SaveMultiple
implements
SourceItemConfigurationsSaveInterface
21
{
25
private
$saveMultipleResourceModel;
26
30
private
$logger;
31
36
public
function
__construct
(
37
SaveMultipleResourceModel $saveMultipleResourceModel,
38
LoggerInterface $logger
39
) {
40
$this->saveMultipleResourceModel = $saveMultipleResourceModel;
41
$this->logger =
$logger
;
42
}
43
47
public
function
execute
(array
$sourceItemConfigurations
): void
48
{
49
if
(empty(
$sourceItemConfigurations
)) {
50
throw
new
InputException
(
__
(
'Input data is empty'
));
51
}
52
try
{
53
$this->saveMultipleResourceModel->execute(
$sourceItemConfigurations
);
54
}
catch
(\Exception $e) {
55
$this->logger->error($e->getMessage());
56
throw
new
CouldNotSaveException
(
__
(
'Could not save Source Item Configuration'
), $e);
57
}
58
}
59
}
Magento\InventoryLowQuantityNotification\Model\SourceItemConfiguration\SaveMultiple
Definition:
SaveMultiple.php:20
__
__()
Definition:
__.php:13
$logger
$logger
Definition:
health_check.php:20
Magento\Framework\Exception\InputException
Definition:
InputException.php:17
Magento\InventoryLowQuantityNotificationApi\Api\SourceItemConfigurationsSaveInterface
Definition:
SourceItemConfigurationsSaveInterface.php:17
Magento\InventoryLowQuantityNotification\Model\ResourceModel\SourceItemConfiguration\SaveMultiple
Definition:
SaveMultiple.php:17
Magento\InventoryLowQuantityNotification\Model\SourceItemConfiguration\SaveMultiple\execute
execute(array $sourceItemConfigurations)
Definition:
SaveMultiple.php:47
$sourceItemConfigurations
$sourceItemConfigurations
Definition:
source_item_configuration.php:48
Magento\InventoryLowQuantityNotification\Model\SourceItemConfiguration\SaveMultiple\__construct
__construct(SaveMultipleResourceModel $saveMultipleResourceModel, LoggerInterface $logger)
Definition:
SaveMultiple.php:36
Magento\Framework\Exception\CouldNotSaveException
Definition:
CouldNotSaveException.php:13
Magento\InventoryLowQuantityNotification\Model\SourceItemConfiguration
Definition:
DeleteMultiple.php:8