6
6
7
7
namespace Magento \SalesSampleData \Setup \Patch \Data ;
8
8
9
+ use Magento \Framework \Indexer \AbstractProcessor ;
9
10
use Magento \Framework \Setup ;
10
11
use Magento \Setup \Model \Patch \DataPatchInterface ;
12
+ use Magento \Setup \Model \Patch \NonTransactionableInterface ;
11
13
use Magento \Setup \Model \Patch \PatchVersionInterface ;
12
14
13
15
/**
14
16
* Class InstallSalesSampleData
15
17
* @package Magento\SalesSampleData\Setup\Patch\Data
16
18
*/
17
- class InstallSalesSampleData implements DataPatchInterface, PatchVersionInterface
19
+ class InstallSalesSampleData implements
20
+ DataPatchInterface,
21
+ PatchVersionInterface,
22
+ NonTransactionableInterface
18
23
{
19
24
/**
20
25
* @var Setup\SampleData\Executor
@@ -26,24 +31,33 @@ class InstallSalesSampleData implements DataPatchInterface, PatchVersionInterfac
26
31
*/
27
32
protected $ installer ;
28
33
34
+ /**
35
+ * @var AbstractProcessor
36
+ */
37
+ private $ indexerProcessor ;
38
+
29
39
/**
30
40
* InstallSalesSampleData constructor.
31
41
* @param Setup\SampleData\Executor $executor
32
42
* @param \Magento\SalesSampleData\Setup\Installer $installer
43
+ * @param AbstractProcessor $indexerProcessor
33
44
*/
34
45
public function __construct (
35
46
Setup \SampleData \Executor $ executor ,
36
- \Magento \SalesSampleData \Setup \Installer $ installer
47
+ \Magento \SalesSampleData \Setup \Installer $ installer ,
48
+ \Magento \CatalogInventory \Model \Indexer \Stock \Processor $ indexerProcessor
37
49
) {
38
50
$ this ->executor = $ executor ;
39
51
$ this ->installer = $ installer ;
52
+ $ this ->indexerProcessor = $ indexerProcessor ;
40
53
}
41
54
42
55
/**
43
56
* {@inheritdoc}
44
57
*/
45
58
public function apply ()
46
59
{
60
+ $ this ->indexerProcessor ->reindexAll ();
47
61
$ this ->executor ->exec ($ this ->installer );
48
62
}
49
63
0 commit comments