44 lines
1.0 KiB
PHP
44 lines
1.0 KiB
PHP
<?php
|
|
|
|
namespace KupShop\PohodaBundle\Resources\script;
|
|
|
|
use KupShop\AdminBundle\Util\Script\Script;
|
|
use KupShop\KupShopBundle\Util\Compat\ServiceContainer;
|
|
use KupShop\PohodaBundle\Utils\Exporters\OrdersExporter;
|
|
|
|
class PohodaOrdersUploadScript extends Script
|
|
{
|
|
protected static $defaultParameters = [
|
|
'orders_ids' => ['123', '456'],
|
|
'display' => true,
|
|
];
|
|
|
|
/**
|
|
* @var OrdersExporter
|
|
*/
|
|
protected $ordersExporter;
|
|
|
|
protected static $name = '[Pohoda] Nahrát objednávky do Pohody';
|
|
|
|
public function __construct()
|
|
{
|
|
$this->ordersExporter = ServiceContainer::getService(OrdersExporter::class);
|
|
}
|
|
|
|
protected function run(array $arguments)
|
|
{
|
|
if ($arguments['orders_ids'] ?? false) {
|
|
if ($arguments['display']) {
|
|
var_dump($arguments['orders_ids']);
|
|
|
|
return;
|
|
}
|
|
|
|
$this->ordersExporter->setIDs($arguments['orders_ids']);
|
|
$this->ordersExporter->processData();
|
|
}
|
|
}
|
|
}
|
|
|
|
return PohodaOrdersUploadScript::class;
|