You are here

function commerce_customer_profile_new in Commerce Core 7

Returns an initialized customer profile object.

Parameters

$type: The type of customer profile to create.

$uid: The uid of the user the customer profile is for.

Return value

A customer profile object with all default fields initialized.

7 calls to commerce_customer_profile_new()
CommerceBaseTestCase::createDummyCustomerProfile in tests/commerce_base.test
Create a customer profile.
commerce_customer_field_widget_form in modules/customer/commerce_customer.module
Implements hook_field_widget_form().
commerce_customer_handler_field_customer_profile_link_delete::render in modules/customer/includes/views/handlers/commerce_customer_handler_field_customer_profile_link_delete.inc
Render the field.
commerce_customer_handler_field_customer_profile_link_edit::render in modules/customer/includes/views/handlers/commerce_customer_handler_field_customer_profile_link_edit.inc
Render the field.
commerce_customer_profile_pane_checkout_form in modules/customer/includes/commerce_customer.checkout_pane.inc
Checkout pane callback: returns a customer profile edit form.

... See full list

File

modules/customer/commerce_customer.module, line 583
Defines the customer profile entity and API functions to manage customers and interact with them.

Code

function commerce_customer_profile_new($type = '', $uid = 0) {
  return entity_get_controller('commerce_customer_profile')
    ->create(array(
    'type' => $type,
    'uid' => $uid,
  ));
}