You are here

function commerce_customer_profile_label in Commerce Core 7

Entity label callback: returns the label for an individual customer profile.

1 string reference to 'commerce_customer_profile_label'
commerce_customer_entity_info in modules/customer/commerce_customer.module
Implements hook_entity_info().

File

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

Code

function commerce_customer_profile_label($profile) {

  // Load the customer profile type to look find the label callback.
  $profile_type = commerce_customer_profile_type_load($profile->type);

  // Make sure we get a valid label callback.
  $callback = $profile_type['label_callback'];
  if (!is_callable($callback)) {
    $callback = 'commerce_customer_profile_default_label';
  }
  return $callback($profile);
}