public function getLineItemForProduct(Product $product)
    {
        foreach ($this->getLineItems() as $lineItem)
        {
            if ($lineItem->getProduct()->getId() == $product->getId())
            {
                return $lineItem;
            }
        }

        return $this->createLineItemForProduct($product);
    }
public function getLineItemForProduct(Product $product)
    {
        foreach ($this->getLineItems() as $lineItem)
        {
            if ($lineItem->getProduct()->getId() == $product->getId())
            {
                return $lineItem;
            }
        }

        return $this->createLineItemForProduct($product);
    }
public function getLineItemForProduct ( Product $ product ) { foreach ( $ this -> getLineItems ( ) as $ lineItem ) { if ( $ lineItem -> getProduct ( ) -> getId ( ) == $ product -> getId ( ) ) { return $ lineItem ; } } return $ this -> createLineItemForProduct ( $ product ) ; }
Get OrderLineItem for given Product

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

@param  HarvestCloud\CoreBundle\Entity\Product

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