function views_handler_field::is_value_empty

Checks if a field value is empty.

Parameters

mixed $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.

2 calls to views_handler_field::is_value_empty()
views_handler_field::advanced_render in handlers/views_handler_field.inc
Render a field using advanced settings.
views_handler_field::render_text in handlers/views_handler_field.inc
Perform an advanced text render for the item.

File

handlers/views_handler_field.inc, line 1169

Class

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

Code

public 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;
}