public function createOrderLineByCartLine(
        OrderInterface $order,
        CartLineInterface $cartLine
    ) {
        $orderLine = ($cartLine->getOrderLine() instanceof OrderLineInterface)
            ? $cartLine->getOrderLine()
            : $this->orderLineFactory->create();

        /**
         * @var OrderLineInterface $orderLine
         */
        $orderLine
            ->setOrder($order)
            ->setPurchasable($cartLine->getPurchasable())
            ->setQuantity($cartLine->getQuantity())
            ->setPurchasableAmount($cartLine->getPurchasableAmount())
            ->setAmount($cartLine->getAmount())
            ->setHeight($cartLine->getHeight())
            ->setWidth($cartLine->getWidth())
            ->setDepth($cartLine->getDepth())
            ->setWeight($cartLine->getWeight());

        $this
            ->orderLineEventDispatcher
            ->dispatchOrderLineOnCreatedEvent(
                $order,
                $cartLine,
                $orderLine
            );

        return $orderLine;
    }
public function createOrderLineByCartLine(
        OrderInterface $order,
        CartLineInterface $cartLine
    ) {
        $orderLine = ($cartLine->getOrderLine() instanceof OrderLineInterface)
            ? $cartLine->getOrderLine()
            : $this->orderLineFactory->create();

        /**
         * @var OrderLineInterface $orderLine
         */
        $orderLine
            ->setOrder($order)
            ->setPurchasable($cartLine->getPurchasable())
            ->setQuantity($cartLine->getQuantity())
            ->setPurchasableAmount($cartLine->getPurchasableAmount())
            ->setAmount($cartLine->getAmount())
            ->setHeight($cartLine->getHeight())
            ->setWidth($cartLine->getWidth())
            ->setDepth($cartLine->getDepth())
            ->setWeight($cartLine->getWeight());

        $this
            ->orderLineEventDispatcher
            ->dispatchOrderLineOnCreatedEvent(
                $order,
                $cartLine,
                $orderLine
            );

        return $orderLine;
    }
public function createOrderLineByCartLine ( OrderInterface $ order , CartLineInterface $ cartLine ) { $ orderLine = ( $ cartLine -> getOrderLine ( ) instanceof OrderLineInterface ) ? $ cartLine -> getOrderLine ( ) : $ this -> orderLineFactory -> create ( ) ; /**
         * @var OrderLineInterface $orderLine
         */ $ orderLine -> setOrder ( $ order ) -> setPurchasable ( $ cartLine -> getPurchasable ( ) ) -> setQuantity ( $ cartLine -> getQuantity ( ) ) -> setPurchasableAmount ( $ cartLine -> getPurchasableAmount ( ) ) -> setAmount ( $ cartLine -> getAmount ( ) ) -> setHeight ( $ cartLine -> getHeight ( ) ) -> setWidth ( $ cartLine -> getWidth ( ) ) -> setDepth ( $ cartLine -> getDepth ( ) ) -> setWeight ( $ cartLine -> getWeight ( ) ) ; $ this -> orderLineEventDispatcher -> dispatchOrderLineOnCreatedEvent ( $ order , $ cartLine , $ orderLine ) ; return $ orderLine ; }
Given a cart line, creates a new order line.

@param OrderInterface    $order    Order
@param CartLineInterface $cartLine Cart Line

@return OrderLineInterface OrderLine created
Given a cart line creates a new order line .