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
StockSourceLink
Command
StockSourceLinksDelete.php
Go to the documentation of this file.
1
<?php
6
declare(strict_types=1);
7
8
namespace
Magento\Inventory\Model\StockSourceLink\Command
;
9
10
use Exception;
11
use
Magento\Framework\Exception\CouldNotDeleteException
;
12
use
Magento\Framework\Exception\InputException
;
13
use
Magento\Inventory\Model\ResourceModel\StockSourceLink\DeleteMultiple
;
14
use
Magento\InventoryApi\Api\StockSourceLinksDeleteInterface
;
15
use Psr\Log\LoggerInterface;
16
20
class
StockSourceLinksDelete
implements
StockSourceLinksDeleteInterface
21
{
25
private
$deleteMultiple;
26
30
private
$logger;
31
36
public
function
__construct
(
37
DeleteMultiple
$deleteMultiple,
38
LoggerInterface $logger
39
) {
40
$this->deleteMultiple = $deleteMultiple;
41
$this->logger =
$logger
;
42
}
43
47
public
function
execute
(array
$links
): void
48
{
49
if
(empty(
$links
)) {
50
throw
new
InputException
(
__
(
'Input data is empty'
));
51
}
52
53
try
{
54
$this->deleteMultiple->execute(
$links
);
55
}
catch
(Exception $e) {
56
$this->logger->error($e->getMessage());
57
throw
new
CouldNotDeleteException
(
__
(
'Could not delete StockSourceLinks'
), $e);
58
}
59
}
60
}
Magento\Inventory\Model\StockSourceLink\Command\StockSourceLinksDelete\execute
execute(array $links)
Definition:
StockSourceLinksDelete.php:47
Magento\Inventory\Model\StockSourceLink\Command\StockSourceLinksDelete\__construct
__construct(DeleteMultiple $deleteMultiple, LoggerInterface $logger)
Definition:
StockSourceLinksDelete.php:36
__
__()
Definition:
__.php:13
$logger
$logger
Definition:
health_check.php:20
Magento\Inventory\Model\ResourceModel\StockSourceLink\DeleteMultiple
Definition:
DeleteMultiple.php:18
Magento\Framework\Exception\InputException
Definition:
InputException.php:17
Magento\Inventory\Model\StockSourceLink\Command
Definition:
GetStockSourceLinks.php:8
$links
$links
Definition:
downloadable_product_with_files_and_sample_url.php:39
Magento\InventoryApi\Api\StockSourceLinksDeleteInterface
Definition:
StockSourceLinksDeleteInterface.php:18
Magento\Framework\Exception\CouldNotDeleteException
Definition:
CouldNotDeleteException.php:12
Magento\Inventory\Model\StockSourceLink\Command\StockSourceLinksDelete
Definition:
StockSourceLinksDelete.php:20