-
Notifications
You must be signed in to change notification settings - Fork 250
/
Copy pathCompositeProductSalabilityChangeProcessor.php
50 lines (47 loc) · 1.67 KB
/
CompositeProductSalabilityChangeProcessor.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?php
/************************************************************************
*
* Copyright 2024 Adobe
* All Rights Reserved.
*
* NOTICE: All information contained herein is, and remains
* the property of Adobe and its suppliers, if any. The intellectual
* and technical concepts contained herein are proprietary to Adobe
* and its suppliers and are protected by all applicable intellectual
* property laws, including trade secret and copyright laws.
* Dissemination of this information or reproduction of this material
* is strictly forbidden unless prior written permission is obtained
* from Adobe.
* ************************************************************************
*/
declare(strict_types=1);
namespace Magento\InventoryIndexer\Model;
class CompositeProductSalabilityChangeProcessor implements ProductSalabilityChangeProcessorInterface
{
/**
* @param ProductSalabilityChangeProcessorInterface[] $processors
*/
public function __construct(private readonly array $processors)
{
foreach ($processors as $processor) {
if (!$processor instanceof ProductSalabilityChangeProcessorInterface) {
throw new \InvalidArgumentException(
sprintf(
'Product salability change processor %s must implement %s',
get_class($processor),
ProductSalabilityChangeProcessorInterface::class
)
);
}
}
}
/**
* @inheritdoc
*/
public function execute(array $skus): void
{
foreach ($this->processors as $processor) {
$processor->execute($skus);
}
}
}