|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
declare(strict_types=1); |
|
4
|
|
|
|
|
5
|
|
|
namespace Odiseo\SyliusMailchimpPlugin\Command; |
|
6
|
|
|
|
|
7
|
|
|
use Symfony\Component\Console\Input\ArrayInput; |
|
8
|
|
|
use Symfony\Component\Console\Input\InputInterface; |
|
9
|
|
|
use Symfony\Component\Console\Output\OutputInterface; |
|
10
|
|
|
use Symfony\Component\Console\Style\SymfonyStyle; |
|
11
|
|
|
|
|
12
|
|
|
class SyncAllCommand extends BaseSyncCommand |
|
13
|
|
|
{ |
|
14
|
|
|
/** |
|
15
|
|
|
* {@inheritdoc} |
|
16
|
|
|
*/ |
|
17
|
|
|
protected function configure() |
|
18
|
|
|
{ |
|
19
|
|
|
$this |
|
20
|
|
|
->setName('odiseo:mailchimp:sync-all') |
|
21
|
|
|
->setDescription('Synchronize all data to Mailchimp.') |
|
22
|
|
|
; |
|
23
|
|
|
} |
|
24
|
|
|
|
|
25
|
|
|
/** |
|
26
|
|
|
* {@inheritdoc} |
|
27
|
|
|
*/ |
|
28
|
|
|
protected function execute(InputInterface $input, OutputInterface $output) |
|
29
|
|
|
{ |
|
30
|
|
|
$this->io = new SymfonyStyle($input, $output); |
|
31
|
|
|
|
|
32
|
|
|
$this->io->title('Synchronizing all data to Mailchimp'); |
|
33
|
|
|
|
|
34
|
|
|
$syncStoresCommand = $this->getApplication()->find('odiseo:mailchimp:sync-stores'); |
|
35
|
|
|
$syncCustomersCommand = $this->getApplication()->find('odiseo:mailchimp:sync-customers'); |
|
36
|
|
|
$syncProductsCommand = $this->getApplication()->find('odiseo:mailchimp:sync-products'); |
|
37
|
|
|
$syncCartsCommand = $this->getApplication()->find('odiseo:mailchimp:sync-carts'); |
|
38
|
|
|
$syncOrdersCommand = $this->getApplication()->find('odiseo:mailchimp:sync-orders'); |
|
39
|
|
|
|
|
40
|
|
|
$syncStoresCommand->run(new ArrayInput([ |
|
41
|
|
|
'--isSyncing' => true, |
|
42
|
|
|
]), $output); |
|
43
|
|
|
|
|
44
|
|
|
$syncCustomersCommand->run(new ArrayInput([]), $output); |
|
45
|
|
|
$syncProductsCommand->run(new ArrayInput([]), $output); |
|
46
|
|
|
$syncCartsCommand->run(new ArrayInput([]), $output); |
|
47
|
|
|
$syncOrdersCommand->run(new ArrayInput([]), $output); |
|
48
|
|
|
|
|
49
|
|
|
$syncStoresCommand->run(new ArrayInput([ |
|
50
|
|
|
'--isSyncing' => false, |
|
51
|
|
|
]), $output); |
|
52
|
|
|
} |
|
53
|
|
|
} |
|
54
|
|
|
|