function FieldPluginBase::isValueEmpty

Same name in other branches
  1. 9 core/modules/views/src/Plugin/views/field/FieldPluginBase.php \Drupal\views\Plugin\views\field\FieldPluginBase::isValueEmpty()
  2. 8.9.x core/modules/views/src/Plugin/views/field/FieldPluginBase.php \Drupal\views\Plugin\views\field\FieldPluginBase::isValueEmpty()
  3. 11.x core/modules/views/src/Plugin/views/field/FieldPluginBase.php \Drupal\views\Plugin\views\field\FieldPluginBase::isValueEmpty()

Overrides FieldHandlerInterface::isValueEmpty

2 calls to FieldPluginBase::isValueEmpty()
FieldPluginBase::advancedRender in core/modules/views/src/Plugin/views/field/FieldPluginBase.php
Renders a field using advanced settings.
FieldPluginBase::renderText in core/modules/views/src/Plugin/views/field/FieldPluginBase.php
Performs an advanced text render for the item.

File

core/modules/views/src/Plugin/views/field/FieldPluginBase.php, line 1262

Class

FieldPluginBase
Base class for views fields.

Namespace

Drupal\views\Plugin\views\field

Code

public function isValueEmpty($value, $empty_zero, $no_skip_empty = TRUE) {
    // Convert MarkupInterface to a string for checking.
    if ($value instanceof MarkupInterface) {
        $value = (string) $value;
    }
    if (!isset($value)) {
        $empty = TRUE;
    }
    else {
        $empty = $empty_zero || $value !== 0 && $value !== '0';
    }
    if ($no_skip_empty) {
        $empty = empty($value) && $empty;
    }
    return $empty;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.