Create a new ProductOrderItem.
@param  ProductOrderItem $productOrderItem the productOrderItem instance.
@return ProductOrderItem       the productOrderItem instance.
19939
public function create(ProductOrderItem $productOrderItem)
    {
        $this->getEm()->persist($productOrderItem);
        $this->getEm()->flush();

        return $productOrderItem;
    }
424136
@Override
	@Transactional(enabled = false)
	public CommerceOrderItem createCommerceOrderItem(long commerceOrderItemId) {
		return commerceOrderItemPersistence.create(commerceOrderItemId);
	}
942402
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;
    }
157018
public function setProductName($productName) {
        if (empty($productName))
            throw new Exception('Product name must be set and cannot be empty.');

        $this->productName = trim($productName);

        return $this;
    }
543246
public function newAction()
    {
        $entity = new Product();

        $entity = $this->addProductItemFieldData($entity);


        $form = $this->createCreateForm($entity);

        return array(
            'entity' => $entity,
            'form' => $form->createView(),
        );
    }
425661
@Override
	public com.liferay.commerce.model.CommerceOrderItem createCommerceOrderItem(
		long commerceOrderItemId) {
		return _commerceOrderItemLocalService.createCommerceOrderItem(commerceOrderItemId);
	}
1306759
public function setProduct(\Sulu\Bundle\ProductBundle\Entity\ProductInterface $product = null)
    {
        $this->product = $product;

        return $this;
    }
57029
public static com.liferay.commerce.model.CommerceOrder createCommerceOrder(
		long commerceOrderId) {
		return getService().createCommerceOrder(commerceOrderId);
	}
876739
public function addProductorder(\Flowcode\ShopBundle\Entity\ProductOrder $productorders)
    {
        $this->productorders[] = $productorders;

        return $this;
    }
797494
function createOrder()
    {
        // Make order
        $productCollectionID = $this->attribute( 'productcollection_id' );

        $user = eZUser::currentUser();
        $userID = $user->attribute( 'contentobject_id' );

        $time = time();
        $order = new eZOrder( array( 'productcollection_id' => $productCollectionID,
                                     'user_id' => $userID,
                                     'is_temporary' => 1,
                                     'created' => $time,
                                     'status_id' => eZOrderStatus::PENDING,
                                     'status_modified' => $time,
                                     'status_modifier_id' => $userID
                                     ) );

        $db = eZDB::instance();
        $db->begin();
        $order->store();

        $orderID = $order->attribute( 'id' );
        $this->setAttribute( 'order_id', $orderID );
        $this->store();
        $db->commit();

        return $order;
    }
1124104
static function create( $productCollectionItemID, $optionItemID, $optionName, $optionValue, $optionPrice, $attributeID )
    {
        $row = array( 'item_id' => $productCollectionItemID,
                      'option_item_id' => $optionItemID,
                      'name' => $optionName,
                      'value' => $optionValue,
                      'price' => $optionPrice,
                      'object_attribute_id' => $attributeID );
        return new eZProductCollectionItemOption( $row );
    }
50033
@Override
	public com.liferay.commerce.model.CommerceOrder createCommerceOrder(
		long commerceOrderId) {
		return _commerceOrderLocalService.createCommerceOrder(commerceOrderId);
	}
798761
public function setProduct($product = null)
    {
        $productEntity = $product;
        // if api-product - temporarily save
        if ($product instanceof ApiProductInterface) {
            $this->tempProduct = $product;
            $productEntity = $product->getEntity();
        }
        $this->entity->setProduct($productEntity);

        return $this;
    }
65085
protected function setItemByProductData($productData, ApiItemInterface $item, $locale)
    {
        $productId = $this->getProductId($productData, 'product.id');

        /** @var Product $product */
        $product = $this->productRepository->find($productId);
        if (!$product) {
            throw new ProductNotFoundException(self::$productEntityName, $productId);
        }
        $item->setProduct($product);
        $translation = $product->getTranslation($locale);

        // When the product is not available in the current language choose the first translation you find.
        if (is_null($translation)) {
            if (count($product->getTranslations()) > 0) {
                $translation = $product->getTranslations()[0];
            } else {
                throw new ProductException('Product ' . $product->getId() . ' has no translations!');
            }
        }

        $this->setItemSupplier($item, $product);

        $item->setName($translation->getName());
        $item->setDescription($translation->getLongDescription());
        $item->setNumber($product->getNumber());

        // set order unit
        if ($product->getOrderUnit()) {
            $item->setQuantityUnit($product->getOrderUnit()->getTranslation($locale)->getName());
        } else if ($product->getParent() && $product->getParent()->getOrderUnit()) {
            $item->setQuantityUnit($product->getParent()->getOrderUnit()->getTranslation($locale)->getName());
        }

        $item->setIsRecurringPrice($product->isRecurringPrice());

        $taxClass = $product->getTaxClass();

        /*
         * If the product doesn't have a taxClass but has a parent, we try to get the taxClass from the parent.
         * This is used for product variants, which get the taxClass from the original product.
         */
        if (!$taxClass && $product->getParent()) {
            $taxClass = $product->getParent()->getTaxClass();
        }

        if ($taxClass) {
            $tax = $this->retrieveTaxForClass($taxClass);
            $item->setTax($tax);
        } else {
            $item->setTax(0);
        }

        return $product;
    }
484155
public function create($data, $productId = null)
    {
        if (isset($productId)) {
            return $this->client()->put($data, 'products/{productId}', ['productId' => $productId]);
        }

        return $this->client()->post($data, 'products');
    }
1362186
public function setProductTemplateAction($productId)
    {
        // Check current user authorization
        if (null !== $response = $this->checkAuth($this->resourceCode, array(), AccessManager::UPDATE)) {
            return $response;
        }

        $product = ProductQuery::create()->findPk($productId);

        if ($product != null) {
            $template_id = \intval($this->getRequest()->get('template_id', 0));

            $this->dispatch(
                TheliaEvents::PRODUCT_SET_TEMPLATE,
                new ProductSetTemplateEvent($product, $template_id, $this->getCurrentEditionCurrency()->getId())
            );
        }

        return $this->redirectToEditionTemplate();
    }
277331
public function createProductAttribute(
        Attribute $attribute,
        ProductInterface $product,
        AttributeValue $attributeValue
    ) {
        $productAttribute = $this->productAttributeRepository->createNew();
        $productAttribute->setAttribute($attribute);
        $productAttribute->setProduct($product);
        $productAttribute->setAttributeValue($attributeValue);
        $this->entityManager->persist($productAttribute);

        $product->addProductAttribute($productAttribute);

        return $productAttribute;
    }