You are here

function commerce_customer_field_is_empty in Commerce Core 7

Implements hook_field_is_empty().

File

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

Code

function commerce_customer_field_is_empty($item, $field) {
  if ($field['type'] == 'commerce_customer_profile_reference') {

    // profile_id = 0 is empty too, which is exactly what we want.
    return empty($item['profile_id']);
  }
}