1 views_handler_field.inc views_handler_field::is_value_empty($value, $empty_zero, $no_skip_empty = TRUE)

Checks if a field value is empty.

Parameters

$value: The field value.

bool $empty_zero: Whether or not this field is configured to consider 0 as empty.

bool $no_skip_empty: Whether or not to use empty() to check the value.

Return value

bool TRUE if the value is considered empty, FALSE otherwise.

File

core/modules/views/handlers/views_handler_field.inc, line 1158
@todo.

Class

views_handler_field
Base field handler that has no options and renders an unformatted field.

Code

function is_value_empty($value, $empty_zero, $no_skip_empty = TRUE) {
  if (!isset($value)) {
    $empty = TRUE;
  }
  else {
    $empty = ($empty_zero || ($value !== 0 && $value !== '0'));
  }

  if ($no_skip_empty) {
    $empty = empty($value) && $empty;
  }
  return $empty;
}