You are here

function entityreference_field_is_empty in Entity reference 7

Same name and namespace in other branches
  1. 8 entityreference.module \entityreference_field_is_empty()

Implements hook_field_is_empty().

1 call to entityreference_field_is_empty()
entityreference_field_validate in ./entityreference.module
Implements hook_field_validate().

File

./entityreference.module, line 140
Entityreference primary module file.

Code

function entityreference_field_is_empty($item, $field) {
  $empty = !isset($item['target_id']) || !is_numeric($item['target_id']);

  // Invoke the behaviors to allow them to override the empty status.
  foreach (entityreference_get_behavior_handlers($field) as $handler) {
    $handler
      ->is_empty_alter($empty, $item, $field);
  }
  return $empty;
}