Files
kupshop/bundles/KupShop/OSSVatsBundle/EventSubscriber/OSSVatsSubscriber.php
2025-08-02 16:30:27 +02:00

34 lines
752 B
PHP

<?php
namespace KupShop\OSSVatsBundle\EventSubscriber;
use KupShop\KupShopBundle\Event\CronEvent;
use KupShop\OSSVatsBundle\Util\VatsUtil;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
class OSSVatsSubscriber implements EventSubscriberInterface
{
/** @var VatsUtil */
protected $vatsUtil;
public function __construct(VatsUtil $vatsUtil)
{
$this->vatsUtil = $vatsUtil;
}
public static function getSubscribedEvents()
{
return [
CronEvent::RUN_EXPENSIVE => [
['loadVatRates', 1500],
],
];
}
public function loadVatRates()
{
$this->vatsUtil->updateVatRates();
$this->vatsUtil->refreshVatsCnsRelations();
}
}