66
77namespace Magento \SalesSampleData \Setup \Patch \Data ;
88
9+ use Magento \Framework \Indexer \AbstractProcessor ;
910use Magento \Framework \Setup ;
1011use Magento \Setup \Model \Patch \DataPatchInterface ;
12+ use Magento \Setup \Model \Patch \NonTransactionableInterface ;
1113use Magento \Setup \Model \Patch \PatchVersionInterface ;
1214
1315/**
1416 * Class InstallSalesSampleData
1517 * @package Magento\SalesSampleData\Setup\Patch\Data
1618 */
17- class InstallSalesSampleData implements DataPatchInterface, PatchVersionInterface
19+ class InstallSalesSampleData implements
20+ DataPatchInterface,
21+ PatchVersionInterface,
22+ NonTransactionableInterface
1823{
1924 /**
2025 * @var Setup\SampleData\Executor
@@ -26,24 +31,33 @@ class InstallSalesSampleData implements DataPatchInterface, PatchVersionInterfac
2631 */
2732 protected $ installer ;
2833
34+ /**
35+ * @var AbstractProcessor
36+ */
37+ private $ indexerProcessor ;
38+
2939 /**
3040 * InstallSalesSampleData constructor.
3141 * @param Setup\SampleData\Executor $executor
3242 * @param \Magento\SalesSampleData\Setup\Installer $installer
43+ * @param AbstractProcessor $indexerProcessor
3344 */
3445 public function __construct (
3546 Setup \SampleData \Executor $ executor ,
36- \Magento \SalesSampleData \Setup \Installer $ installer
47+ \Magento \SalesSampleData \Setup \Installer $ installer ,
48+ \Magento \CatalogInventory \Model \Indexer \Stock \Processor $ indexerProcessor
3749 ) {
3850 $ this ->executor = $ executor ;
3951 $ this ->installer = $ installer ;
52+ $ this ->indexerProcessor = $ indexerProcessor ;
4053 }
4154
4255 /**
4356 * {@inheritdoc}
4457 */
4558 public function apply ()
4659 {
60+ $ this ->indexerProcessor ->reindexAll ();
4761 $ this ->executor ->exec ($ this ->installer );
4862 }
4963
0 commit comments