You are here

function vat_number_field_is_empty in VAT Number 7

Implements hook_field_is_empty().

hook_field_is_emtpy() is where Drupal asks us if this field is empty. Return TRUE if it does NOT contain data, FALSE if it does. This lets the form API flag an error when required fields are empty.

File

./vat_number.module, line 171
Define a VAT Number field for use on Drupal Commerce Customer Profiles.

Code

function vat_number_field_is_empty($item, $field) {
  if (empty($item['value']) && (string) $item['value'] !== '0') {
    return TRUE;
  }
  return FALSE;
}