function fraction_field_is_empty in Fraction 7
Implements hook_field_is_empty().
1 call to fraction_field_is_empty()
- fraction_field_widget_form in ./
fraction.field.inc - Implements hook_field_widget_form().
File
- ./
fraction.field.inc, line 149 - Fraction Field API functions
Code
function fraction_field_is_empty($item, $field) {
// This field is empty if:
// a) numerator is not set, or
// b) denominator is not set, or
// c) denominator is empty (eg: zero), or
// d) numerator is an empty string
return !isset($item['numerator']) || !isset($item['denominator']) || empty($item['denominator']) || (string) $item['numerator'] === '';
}