You are here

function bat_options_field_is_empty in Booking and Availability Management Tools for Drupal 7

Implements hook_field_is_empty().

File

modules/bat_options/bat_options.module, line 125

Code

function bat_options_field_is_empty($item, $field) {
  $per_person = isset($field['settings']['per_person']) ? $field['settings']['per_person'] : FALSE;
  return empty($item['name']) || empty($item['quantity']) || !(is_numeric($item['quantity']) && is_int((int) $item['quantity'])) || (empty($item['value']) || !is_numeric($item['value'])) && $item['operation'] != 'no_charge' || empty($item['operation']) || !in_array($item['operation'], array_keys(bat_options_price_options($per_person)));
}