public function update(CurrencyUpdateEvent $event, $eventName, EventDispatcherInterface $dispatcher)
    {
        if (null !== $currency = CurrencyQuery::create()->findPk($event->getCurrencyId())) {
            $currency
                ->setDispatcher($dispatcher)

                ->setLocale($event->getLocale())
                ->setName($event->getCurrencyName())
                ->setSymbol($event->getSymbol())
                ->setFormat($event->getFormat())
                ->setRate($event->getRate())
                ->setCode(strtoupper($event->getCode()))

                ->save();

            $event->setCurrency($currency);
        }
    }
public function update(CurrencyUpdateEvent $event, $eventName, EventDispatcherInterface $dispatcher)
    {
        if (null !== $currency = CurrencyQuery::create()->findPk($event->getCurrencyId())) {
            $currency
                ->setDispatcher($dispatcher)

                ->setLocale($event->getLocale())
                ->setName($event->getCurrencyName())
                ->setSymbol($event->getSymbol())
                ->setFormat($event->getFormat())
                ->setRate($event->getRate())
                ->setCode(strtoupper($event->getCode()))

                ->save();

            $event->setCurrency($currency);
        }
    }
public function update ( CurrencyUpdateEvent $ event , $ eventName , EventDispatcherInterface $ dispatcher ) { if ( null !== $ currency = CurrencyQuery :: create ( ) -> findPk ( $ event -> getCurrencyId ( ) ) ) { $ currency -> setDispatcher ( $ dispatcher ) -> setLocale ( $ event -> getLocale ( ) ) -> setName ( $ event -> getCurrencyName ( ) ) -> setSymbol ( $ event -> getSymbol ( ) ) -> setFormat ( $ event -> getFormat ( ) ) -> setRate ( $ event -> getRate ( ) ) -> setCode ( strtoupper ( $ event -> getCode ( ) ) ) -> save ( ) ; $ event -> setCurrency ( $ currency ) ; } }
Change a currency

@param \Thelia\Core\Event\Currency\CurrencyUpdateEvent $event
@param $eventName
@param EventDispatcherInterface $dispatcher
Change a currency