You are here

function mvf_field_is_empty in Measured Value Field 7

Implements hook_field_is_empty().

File

./mvf.module, line 1026
Define a field type of measured value.

Code

function mvf_field_is_empty($item, $field) {

  // If at least one sub field is empty, the entire field is considered empty.
  $is_empty = FALSE;
  foreach ($field['settings']['meta_info'] as $subfield => $meta_info) {
    $mocked_field = mvf_field_mockup($field, $subfield);
    $is_empty = $is_empty || (bool) module_invoke($mocked_field['module'], 'field_is_empty', $item, $mocked_field);
  }
  return $is_empty;
}