Skip to content

Commit 987f146

Browse files
committed
ACP2E-767: Remove Magento Catalog dependency on Magento Inventory
1 parent c26aca7 commit 987f146

File tree

4 files changed

+78
-2
lines changed

4 files changed

+78
-2
lines changed

app/etc/di.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2005,4 +2005,5 @@
20052005
<preference for="Magento\Framework\Filter\Input\PurifierInterface" type="Magento\Framework\Filter\Input\Purifier"/>
20062006
<preference for="Magento\Framework\App\PageCache\IdentifierInterface" type="Magento\Framework\App\PageCache\Identifier"/>
20072007
<preference for="Magento\Framework\App\State\ReloadProcessorInterface" type="Magento\Framework\App\State\ReloadProcessorComposite" />
2008+
<preference for="Magento\Framework\Indexer\Config\Converter\SortingAdjustmentInterface" type="Magento\Framework\Indexer\Config\Converter\SortingAdjustment" />
20082009
</config>

lib/internal/Magento/Framework/Indexer/Config/Converter.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,20 @@
88
use Magento\Framework\Config\ConverterInterface;
99
use Magento\Framework\Exception\ConfigurationMismatchException;
1010
use Magento\Framework\Phrase;
11+
use Magento\Framework\Indexer\Config\Converter\SortingAdjustmentInterface;
1112

1213
class Converter implements ConverterInterface
1314
{
15+
/**
16+
* @var SortingAdjustmentInterface
17+
*/
18+
private SortingAdjustmentInterface $sortingAdjustment;
19+
20+
public function __construct(SortingAdjustmentInterface $sortingAdjustment)
21+
{
22+
$this->sortingAdjustment = $sortingAdjustment;
23+
}
24+
1425
/**
1526
* Convert dom node tree to array
1627
*
@@ -47,8 +58,7 @@ public function convert($source)
4758
$output[$indexerId] = $data;
4859
}
4960
$output = $this->sortByDependencies($output);
50-
51-
return $output;
61+
return $this->sortingAdjustment->adjust($output);
5262
}
5363

5464
/**
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?php
2+
/************************************************************************
3+
*
4+
* Copyright 2024 Adobe
5+
* All Rights Reserved.
6+
*
7+
* NOTICE: All information contained herein is, and remains
8+
* the property of Adobe and its suppliers, if any. The intellectual
9+
* and technical concepts contained herein are proprietary to Adobe
10+
* and its suppliers and are protected by all applicable intellectual
11+
* property laws, including trade secret and copyright laws.
12+
* Dissemination of this information or reproduction of this material
13+
* is strictly forbidden unless prior written permission is obtained
14+
* from Adobe.
15+
* ************************************************************************
16+
*/
17+
declare(strict_types=1);
18+
19+
namespace Magento\Framework\Indexer\Config\Converter;
20+
21+
class SortingAdjustment implements SortingAdjustmentInterface
22+
{
23+
/**
24+
* @inheirtdoc
25+
*/
26+
public function adjust(array $indexersList): array
27+
{
28+
return $indexersList;
29+
}
30+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?php
2+
/************************************************************************
3+
*
4+
* Copyright 2024 Adobe
5+
* All Rights Reserved.
6+
*
7+
* NOTICE: All information contained herein is, and remains
8+
* the property of Adobe and its suppliers, if any. The intellectual
9+
* and technical concepts contained herein are proprietary to Adobe
10+
* and its suppliers and are protected by all applicable intellectual
11+
* property laws, including trade secret and copyright laws.
12+
* Dissemination of this information or reproduction of this material
13+
* is strictly forbidden unless prior written permission is obtained
14+
* from Adobe.
15+
* ************************************************************************
16+
*/
17+
declare(strict_types=1);
18+
19+
namespace Magento\Framework\Indexer\Config\Converter;
20+
21+
/**
22+
* Interface for managing sort order of indexers
23+
*
24+
* Make sense for the full reindex when you need to adjust order od indexers execution
25+
*/
26+
interface SortingAdjustmentInterface
27+
{
28+
/**
29+
* Make adjustments in the indexers list
30+
*
31+
* @param array $indexersList
32+
* @return array
33+
*/
34+
public function adjust(array $indexersList) : array;
35+
}

0 commit comments

Comments
 (0)