Supplier/EventListener/SupplierOrderListener.php
public function onInitialize(ResourceEventInterface $event)
    {
        $order = $this->getSupplierOrderFromEvent($event);

        if (null !== $supplier = $order->getSupplier()) {
            if ($order->getCurrency() !== $supplier->getCurrency()) {
                $order->setCurrency($supplier->getCurrency());
            }
            if (null === $order->getCarrier()) {
                $order->setCarrier($supplier->getCarrier());
            }
        }
    }
public function onInitialize(ResourceEventInterface $event)
    {
        $order = $this->getSupplierOrderFromEvent($event);

        if (null !== $supplier = $order->getSupplier()) {
            if ($order->getCurrency() !== $supplier->getCurrency()) {
                $order->setCurrency($supplier->getCurrency());
            }
            if (null === $order->getCarrier()) {
                $order->setCarrier($supplier->getCarrier());
            }
        }
    }
public function onInitialize ( ResourceEventInterface $ event ) { $ order = $ this -> getSupplierOrderFromEvent ( $ event ) ; if ( null !== $ supplier = $ order -> getSupplier ( ) ) { if ( $ order -> getCurrency ( ) !== $ supplier -> getCurrency ( ) ) { $ order -> setCurrency ( $ supplier -> getCurrency ( ) ) ; } if ( null === $ order -> getCarrier ( ) ) { $ order -> setCarrier ( $ supplier -> getCarrier ( ) ) ; } } }
Initialize event handler.

@param ResourceEventInterface $event
Initialize event handler .