commerce_product_new

  1. commerce
    1. 7
Versions
7 commerce_product_new($type = '')

Returns an initialized product object.

Parameters

$type The machine-readable type of the product.

Return value

A product object with all default fields initialized.

▾ 7 functions call commerce_product_new()

CommerceBaseTestCase::createDummyProduct in tests/commerce_base.test
Creates a dummy product for use with other tests.
CommerceProductCRUDTestCase::testCommerceProductCrud in modules/product/tests/commerce_product.test
Test the product CRUD functions.
CommerceProductCRUDTestCase::testCommerceProductTokens in modules/product/tests/commerce_product.test
Test product Token replacement.
commerce_product_handler_field_product_link_delete::render in modules/product/includes/views/handlers/commerce_product_handler_field_product_link_delete.inc
Render an element.
commerce_product_handler_field_product_link_edit::render in modules/product/includes/views/handlers/commerce_product_handler_field_product_link_edit.inc
Render an element.
commerce_product_ui_menu in modules/product/commerce_product_ui.module
Implements hook_menu().
commerce_product_ui_product_add_any_access in modules/product/commerce_product_ui.module
Access callback: determines if the user can create any type of product.

Code

modules/product/commerce_product.module, line 449

<?php
function commerce_product_new($type = '') {
  return entity_get_controller('commerce_product')->create(array('type' => $type));
}
?>