<?php

declare(strict_types=1);

namespace External\PompoBundle\Resources\script;

use External\PompoBundle\Util\ProductUtil;
use KupShop\AdminBundle\Util\Script\Script;
use KupShop\KupShopBundle\Util\Compat\ServiceContainer;

class PompoGenerateDiscountFlagsScript extends Script
{
    protected static $name = '[pompo] Vygenerovat discount flagy';

    protected function run(array $arguments)
    {
        ini_set('max_execution_time', '3600');
        ini_set('memory_limit', '2048M');

        $this->log('Generuji...');

        $productUtil = ServiceContainer::getService(ProductUtil::class);
        $productUtil->generateProductDiscountFlags();
        $productUtil->generateProductDiscountLabels();

        $this->log('Done');
    }
}

return PompoGenerateDiscountFlagsScript::class;
