13
13
use Magento \Framework \Indexer \IndexStructureInterface ;
14
14
use Magento \Framework \Indexer \StateInterface ;
15
15
use Magento \Framework \Indexer \StructureFactory ;
16
+ use Magento \Framework \Indexer \IndexerInterfaceFactory ;
16
17
17
18
/**
18
19
* Indexer model.
@@ -66,6 +67,11 @@ class Indexer extends \Magento\Framework\DataObject implements IndexerInterface
66
67
*/
67
68
private $ workingStateProvider ;
68
69
70
+ /**
71
+ * @var IndexerInterfaceFactory
72
+ */
73
+ private $ indexerFactory ;
74
+
69
75
/**
70
76
* @param ConfigInterface $config
71
77
* @param ActionFactory $actionFactory
@@ -74,6 +80,7 @@ class Indexer extends \Magento\Framework\DataObject implements IndexerInterface
74
80
* @param Indexer\StateFactory $stateFactory
75
81
* @param Indexer\CollectionFactory $indexersFactory
76
82
* @param WorkingStateProvider $workingStateProvider
83
+ * @param IndexerInterfaceFactory $indexerFactory
77
84
* @param array $data
78
85
*/
79
86
public function __construct (
@@ -84,6 +91,7 @@ public function __construct(
84
91
Indexer \StateFactory $ stateFactory ,
85
92
Indexer \CollectionFactory $ indexersFactory ,
86
93
WorkingStateProvider $ workingStateProvider ,
94
+ IndexerInterfaceFactory $ indexerFactory ,
87
95
array $ data = []
88
96
) {
89
97
$ this ->config = $ config ;
@@ -93,6 +101,7 @@ public function __construct(
93
101
$ this ->stateFactory = $ stateFactory ;
94
102
$ this ->indexersFactory = $ indexersFactory ;
95
103
$ this ->workingStateProvider = $ workingStateProvider ;
104
+ $ this ->indexerFactory = $ indexerFactory ;
96
105
parent ::__construct ($ data );
97
106
}
98
107
@@ -465,7 +474,7 @@ private function getSharedIndexers(string $sharedIndex) : array
465
474
}
466
475
$ indexerConfig = $ this ->config ->getIndexer ($ indexerId );
467
476
if ($ indexerConfig ['shared_index ' ] === $ sharedIndex ) {
468
- $ indexer = $ this ->indexersFactory ->create ();
477
+ $ indexer = $ this ->indexerFactory ->create ();
469
478
$ indexer ->load ($ indexerId );
470
479
$ result [] = $ indexer ;
471
480
}
0 commit comments