Skip to content

Commit bb6b8e9

Browse files
committed
MAGE-848 Stub patch
1 parent 21603ac commit bb6b8e9

File tree

3 files changed

+70
-16
lines changed

3 files changed

+70
-16
lines changed

Setup/Patch/Data/MigrateConversionAnalyticsModePatch.php

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,21 @@ class MigrateConversionAnalyticsModePatch implements DataPatchInterface
1717
{
1818
public function __construct(
1919
protected ModuleDataSetupInterface $moduleDataSetup,
20-
protected WriterInterface $configWriter,
21-
protected ConfigInterface $config,
22-
protected ScopeConfigInterface $scopeConfig,
23-
protected ConfigChecker $configChecker,
24-
protected StoreManagerInterface $storeManager
25-
) {}
20+
protected WriterInterface $configWriter,
21+
protected ConfigInterface $config,
22+
protected ScopeConfigInterface $scopeConfig,
23+
protected ConfigChecker $configChecker,
24+
protected StoreManagerInterface $storeManager
25+
)
26+
{}
27+
28+
/**
29+
* @inheritDoc
30+
*/
31+
public static function getDependencies(): array
32+
{
33+
return [];
34+
}
2635

2736
/**
2837
* @inheritDoc
@@ -62,14 +71,6 @@ public function migrateSetting(string $scope = ScopeConfigInterface::SCOPE_TYPE_
6271
}
6372
}
6473

65-
/**
66-
* @inheritDoc
67-
*/
68-
public static function getDependencies(): array
69-
{
70-
return [];
71-
}
72-
7374
/**
7475
* @inheritDoc
7576
*/

Setup/Patch/Data/MigrateInstantSearchConfigPatch.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88

99
class MigrateInstantSearchConfigPatch implements DataPatchInterface
1010
{
11-
12-
1311
public function __construct(
1412
protected ModuleDataSetupInterface $moduleDataSetup,
1513
) {}
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
<?php
2+
3+
namespace Algolia\AlgoliaSearch\Setup\Patch\Data;
4+
5+
use Algolia\AlgoliaSearch\Api\Product\ReplicaManagerInterface;
6+
use Algolia\AlgoliaSearch\Helper\Configuration\ConfigChecker;
7+
use Magento\Framework\App\Config\ConfigResource\ConfigInterface;
8+
use Magento\Framework\App\Config\ScopeConfigInterface;
9+
use Magento\Framework\App\Config\Storage\WriterInterface;
10+
use Magento\Framework\Setup\ModuleDataSetupInterface;
11+
use Magento\Framework\Setup\Patch\DataPatchInterface;
12+
use Magento\Framework\Setup\Patch\PatchInterface;
13+
14+
class MigrateVirtualReplicaConfigPatch implements DataPatchInterface
15+
{
16+
public function __construct(
17+
protected ModuleDataSetupInterface $moduleDataSetup,
18+
protected WriterInterface $configWriter,
19+
protected ConfigInterface $config,
20+
protected ScopeConfigInterface $scopeConfig,
21+
protected ConfigChecker $configChecker,
22+
protected ReplicaManagerInterface $replicaManager
23+
)
24+
{}
25+
26+
/**
27+
* @inheritDoc
28+
*/
29+
public static function getDependencies()
30+
{
31+
return [];
32+
}
33+
34+
/**
35+
* @inheritDoc
36+
*/
37+
public function apply(): PatchInterface
38+
{
39+
$this->moduleDataSetup->getConnection()->startSetup();
40+
41+
// do stuff
42+
43+
$this->moduleDataSetup->getConnection()->endSetup();
44+
45+
return $this;
46+
}
47+
48+
/**
49+
* @inheritDoc
50+
*/
51+
public function getAliases()
52+
{
53+
return [];
54+
}
55+
}

0 commit comments

Comments
 (0)