public function createOrderCouponByCoupon(OrderCouponOnApplyEvent $event)
    {
        $orderCoupon = $this
            ->couponToOrderCouponTransformer
            ->createOrderCouponByCoupon(
                $event->getOrder(),
                $event->getCoupon()
            );

        $event->setOrderCoupon($orderCoupon);
    }
public function createOrderCouponByCoupon(OrderCouponOnApplyEvent $event)
    {
        $orderCoupon = $this
            ->couponToOrderCouponTransformer
            ->createOrderCouponByCoupon(
                $event->getOrder(),
                $event->getCoupon()
            );

        $event->setOrderCoupon($orderCoupon);
    }
public function createOrderCouponByCoupon ( OrderCouponOnApplyEvent $ event ) { $ orderCoupon = $ this -> couponToOrderCouponTransformer -> createOrderCouponByCoupon ( $ event -> getOrder ( ) , $ event -> getCoupon ( ) ) ; $ event -> setOrderCoupon ( $ orderCoupon ) ; }
Event subscribed on OrderCoupon applied into an order.

Just should create a new OrderCoupon instance, persist and flush it

Also notifies to CouponBundle that a simple coupon has been
used by an Order.

@param OrderCouponOnApplyEvent $event Event
Event subscribed on OrderCoupon applied into an order .