File tree Expand file tree Collapse file tree 1 file changed +15
-3
lines changed
app/code/Magento/Indexer/Controller/Adminhtml/Indexer Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change 5
5
*/
6
6
namespace Magento \Indexer \Controller \Adminhtml \Indexer ;
7
7
8
+ use Magento \Backend \App \Action \Context ;
8
9
use Magento \Framework \App \Action \HttpPostActionInterface as HttpPostActionInterface ;
10
+ use Magento \Framework \Indexer \IndexerRegistry ;
9
11
10
12
/**
11
13
* Controller endpoint for mass action: invalidate index
12
14
*/
13
15
class MassInvalidate extends \Magento \Indexer \Controller \Adminhtml \Indexer implements HttpPostActionInterface
14
16
{
17
+ /**
18
+ * @param Context $context
19
+ * @param IndexerRegistry $indexerRegistry
20
+ */
21
+ public function __construct (
22
+ Context $ context ,
23
+ IndexerRegistry $ indexerRegistry
24
+ ) {
25
+ parent ::__construct ($ context );
26
+ $ this ->indexerRegistry = $ indexerRegistry ;
27
+ }
28
+
15
29
/**
16
30
* Turn mview on for the given indexers
17
31
*
@@ -26,9 +40,7 @@ public function execute()
26
40
try {
27
41
foreach ($ indexerIds as $ indexerId ) {
28
42
/** @var \Magento\Framework\Indexer\IndexerInterface $model */
29
- $ model = $ this ->_objectManager ->get (
30
- \Magento \Framework \Indexer \IndexerRegistry::class
31
- )->get ($ indexerId );
43
+ $ model = $ this ->indexerRegistry ->get ($ indexerId );
32
44
$ model ->invalidate ();
33
45
}
34
46
$ this ->messageManager ->addSuccess (
You can’t perform that action at this time.
0 commit comments