2
2
3
3
namespace Algolia \AlgoliaSearch \Console \Command ;
4
4
5
+ use Algolia \AlgoliaSearch \Api \Product \ReplicaManagerInterface ;
5
6
use Magento \Framework \Console \Cli ;
6
7
use Symfony \Component \Console \Command \Command ;
7
8
use Symfony \Component \Console \Input \InputInterface ;
8
- use Symfony \Component \Console \Input \InputOption ;
9
9
use Symfony \Component \Console \Input \InputArgument ;
10
10
use Symfony \Component \Console \Output \OutputInterface ;
11
11
12
12
class ReplicaCommand extends Command
13
13
{
14
14
const STORE_ARGUMENT = 'store ' ;
15
15
16
+ /**
17
+ * @param ReplicaManagerInterface $replicaManager
18
+ * @param string|null $name
19
+ */
20
+ public function __construct (
21
+ protected ReplicaManagerInterface $ replicaManager ,
22
+ ?string $ name = null
23
+ )
24
+ {
25
+ parent ::__construct ($ name );
26
+ }
27
+
16
28
/**
17
29
* @inheritDoc
18
30
*/
@@ -30,14 +42,16 @@ protected function configure(): void
30
42
/** @inheritDoc */
31
43
protected function execute (InputInterface $ input , OutputInterface $ output ): int
32
44
{
33
- $ name = $ input ->getArgument (self ::STORE_ARGUMENT );
45
+ $ storeIds = $ input ->getArgument (self ::STORE_ARGUMENT );
34
46
35
- if ($ name ) {
36
- $ output ->writeln ('<info>Syncing store ' . $ name . '!</info> ' );
47
+ if ($ storeIds ) {
48
+ $ output ->writeln ('<info>Syncing store ' . $ storeIds . '!</info> ' );
37
49
} else {
38
50
$ output ->writeln ('<info>Syncing all stores</info> ' );
39
51
}
40
52
53
+ // $this->replicaManager->syncReplicasToAlgolia();
54
+
41
55
return Cli::RETURN_SUCCESS ;
42
56
}
43
57
}
0 commit comments