public function delete(CurrencyDeleteEvent $event, $eventName, EventDispatcherInterface $dispatcher)
    {
        if (null !== ($currency = CurrencyQuery::create()->findPk($event->getCurrencyId()))) {
            if ($currency->getByDefault()) {
                throw new \RuntimeException(
                    Translator::getInstance()->trans('It is not allowed to delete the default currency')
                );
            }

            $currency
                ->setDispatcher($dispatcher)
                ->delete()
            ;

            $event->setCurrency($currency);
        }
    }
public function delete(CurrencyDeleteEvent $event, $eventName, EventDispatcherInterface $dispatcher)
    {
        if (null !== ($currency = CurrencyQuery::create()->findPk($event->getCurrencyId()))) {
            if ($currency->getByDefault()) {
                throw new \RuntimeException(
                    Translator::getInstance()->trans('It is not allowed to delete the default currency')
                );
            }

            $currency
                ->setDispatcher($dispatcher)
                ->delete()
            ;

            $event->setCurrency($currency);
        }
    }
public function delete ( CurrencyDeleteEvent $ event , $ eventName , EventDispatcherInterface $ dispatcher ) { if ( null !== ( $ currency = CurrencyQuery :: create ( ) -> findPk ( $ event -> getCurrencyId ( ) ) ) ) { if ( $ currency -> getByDefault ( ) ) { throw new \ RuntimeException ( Translator :: getInstance ( ) -> trans ( 'It is not allowed to delete the default currency' ) ) ; } $ currency -> setDispatcher ( $ dispatcher ) -> delete ( ) ; $ event -> setCurrency ( $ currency ) ; } }
Delete a currencyuration entry

@param \Thelia\Core\Event\Currency\CurrencyDeleteEvent $event
@param $eventName
@param EventDispatcherInterface $dispatcher
Delete a currencyuration entry