Shipment/EventListener/ShipmentMethodListener.php
public function onInsert(ResourceEventInterface $event)
    {
        $method = $this->getShipmentMethodFromEvent($event);

        if (0 == strlen($method->getGatewayName())) {
            $method->setGatewayName(sprintf(
                '%s-%s',
                Transliterator::transliterate($method->getPlatformName()),
                uniqid()
            ));

            // TODO check uniqueness

            $this->persistenceHelper->persistAndRecompute($method);
        }
    }
public function onInsert(ResourceEventInterface $event)
    {
        $method = $this->getShipmentMethodFromEvent($event);

        if (0 == strlen($method->getGatewayName())) {
            $method->setGatewayName(sprintf(
                '%s-%s',
                Transliterator::transliterate($method->getPlatformName()),
                uniqid()
            ));

            // TODO check uniqueness

            $this->persistenceHelper->persistAndRecompute($method);
        }
    }
public function onInsert ( ResourceEventInterface $ event ) { $ method = $ this -> getShipmentMethodFromEvent ( $ event ) ; if ( 0 == strlen ( $ method -> getGatewayName ( ) ) ) { $ method -> setGatewayName ( sprintf ( '%s-%s' , Transliterator :: transliterate ( $ method -> getPlatformName ( ) ) , uniqid ( ) ) ) ; // TODO check uniqueness $ this -> persistenceHelper -> persistAndRecompute ( $ method ) ; } }
Insert event handler.

@param ResourceEventInterface $event
Insert event handler .