public function getPostage(DeliveryPostageEvent $event, $eventName, EventDispatcherInterface $dispatcher)
    {
        $module = $event->getModule();

        // dispatch event to target specific module
        $dispatcher->dispatch(
            TheliaEvents::getModuleEvent(
                TheliaEvents::MODULE_DELIVERY_GET_POSTAGE,
                $module->getCode()
            ),
            $event
        );

        if ($event->isPropagationStopped()) {
            return;
        }

        // call legacy module method
        $event->setValidModule($module->isValidDelivery($event->getCountry()));
        if ($event->isValidModule()) {
            $event->setPostage($module->getPostage($event->getCountry()));
        }
    }
public function getPostage(DeliveryPostageEvent $event, $eventName, EventDispatcherInterface $dispatcher)
    {
        $module = $event->getModule();

        // dispatch event to target specific module
        $dispatcher->dispatch(
            TheliaEvents::getModuleEvent(
                TheliaEvents::MODULE_DELIVERY_GET_POSTAGE,
                $module->getCode()
            ),
            $event
        );

        if ($event->isPropagationStopped()) {
            return;
        }

        // call legacy module method
        $event->setValidModule($module->isValidDelivery($event->getCountry()));
        if ($event->isValidModule()) {
            $event->setPostage($module->getPostage($event->getCountry()));
        }
    }
public function getPostage ( DeliveryPostageEvent $ event , $ eventName , EventDispatcherInterface $ dispatcher ) { $ module = $ event -> getModule ( ) ; // dispatch event to target specific module $ dispatcher -> dispatch ( TheliaEvents :: getModuleEvent ( TheliaEvents :: MODULE_DELIVERY_GET_POSTAGE , $ module -> getCode ( ) ) , $ event ) ; if ( $ event -> isPropagationStopped ( ) ) { return ; } // call legacy module method $ event -> setValidModule ( $ module -> isValidDelivery ( $ event -> getCountry ( ) ) ) ; if ( $ event -> isValidModule ( ) ) { $ event -> setPostage ( $ module -> getPostage ( $ event -> getCountry ( ) ) ) ; } }
Get postage from module using the classical module functions

@param DeliveryPostageEvent $event
Get postage from module using the classical module functions