You are here

function fc_node_reference_field_is_complete in Field Complete 7

1 string reference to 'fc_node_reference_field_is_complete'
node_reference.inc in plugins/fields/node_reference.inc

File

plugins/fields/node_reference.inc, line 22

Code

function fc_node_reference_field_is_complete($items, $instance, $field, &$completed = array()) {
  $module = $field['module'];
  $check_nodes = !empty($instance['settings']['fc']['fc_check_nodes']);
  foreach ($items as $delta => $item) {
    if ($check_nodes) {

      // Loads each entity to find out whether it is complete
      $node = node_load($item['nid']);
      $completed[] = $node->fc->complete;
    }
    else {

      // Just do a superficial check of item
      $completed[] = !module_invoke($module, 'field_is_empty', $item, $field);
    }
  }
}