public function createLineItemForProduct(Product $product)
    {
        $lineItem = new OrderLineItem();
        $lineItem->setProduct($product);

        // Don't assume any quantity here
        // We will add it later
        $lineItem->setQuantity(0);

        $this->addLineItem($lineItem);

        // Copy SellerWindow
        if ($this->getSellerWindow()) {
            $lineItem->setSellerWindow($this->getSellerWindow());
        }

        return $lineItem;
    }
public function createLineItemForProduct(Product $product)
    {
        $lineItem = new OrderLineItem();
        $lineItem->setProduct($product);

        // Don't assume any quantity here
        // We will add it later
        $lineItem->setQuantity(0);

        $this->addLineItem($lineItem);

        // Copy SellerWindow
        if ($this->getSellerWindow()) {
            $lineItem->setSellerWindow($this->getSellerWindow());
        }

        return $lineItem;
    }
public function createLineItemForProduct ( Product $ product ) { $ lineItem = new OrderLineItem ( ) ; $ lineItem -> setProduct ( $ product ) ; // Don't assume any quantity here // We will add it later $ lineItem -> setQuantity ( 0 ) ; $ this -> addLineItem ( $ lineItem ) ; // Copy SellerWindow if ( $ this -> getSellerWindow ( ) ) { $ lineItem -> setSellerWindow ( $ this -> getSellerWindow ( ) ) ; } return $ lineItem ; }
Create OrderLineItem for given Product

@author Tom Haskins-Vaughan <tom@harvestcloud.com>
@since  2012-04-10

@todo  Work out better default quantity

@param  HarvestCloud\CoreBundle\Entity\Product

@return HarvestCloud\CoreBundle\Entity\OrderLineItem
Create OrderLineItem for given Product