first commit
This commit is contained in:
34
bundles/External/VarioBundle/Resources/script/RunVarioSynchronizationScript.php
vendored
Normal file
34
bundles/External/VarioBundle/Resources/script/RunVarioSynchronizationScript.php
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace External\VarioBundle\Resources\script;
|
||||
|
||||
use External\VarioBundle\Util\SynchronizerLocator;
|
||||
use KupShop\AdminBundle\Util\Script\Script;
|
||||
use KupShop\KupShopBundle\Util\Compat\ServiceContainer;
|
||||
|
||||
class RunVarioSynchronizationScript extends Script
|
||||
{
|
||||
protected static $name = '[Vario] Run synchronization';
|
||||
protected static $defaultParameters = [
|
||||
'type' => 'otProductSimple',
|
||||
'forceSync' => null,
|
||||
];
|
||||
|
||||
protected function run(array $arguments)
|
||||
{
|
||||
$locator = ServiceContainer::getService(SynchronizerLocator::class);
|
||||
|
||||
$this->log('Running...');
|
||||
|
||||
$synchronizer = $locator->getServiceByType($arguments['type']);
|
||||
if (!empty($arguments['forceSync'])) {
|
||||
$synchronizer->setForceSync($arguments['forceSync']);
|
||||
}
|
||||
$synchronizer->setDebug(true);
|
||||
$synchronizer->sync();
|
||||
|
||||
$this->log('Done');
|
||||
}
|
||||
}
|
||||
|
||||
return RunVarioSynchronizationScript::class;
|
||||
Reference in New Issue
Block a user