function DisplayPluginBase::outputIsEmpty

Same name and namespace in other branches
  1. 9 core/modules/views/src/Plugin/views/display/DisplayPluginBase.php \Drupal\views\Plugin\views\display\DisplayPluginBase::outputIsEmpty()
  2. 8.9.x core/modules/views/src/Plugin/views/display/DisplayPluginBase.php \Drupal\views\Plugin\views\display\DisplayPluginBase::outputIsEmpty()
  3. 10 core/modules/views/src/Plugin/views/display/DisplayPluginBase.php \Drupal\views\Plugin\views\display\DisplayPluginBase::outputIsEmpty()

Overrides DisplayPluginInterface::outputIsEmpty

1 call to DisplayPluginBase::outputIsEmpty()
Block::execute in core/modules/views/src/Plugin/views/display/Block.php
The display block handler returns the structure necessary for a block.

File

core/modules/views/src/Plugin/views/display/DisplayPluginBase.php, line 2595

Class

DisplayPluginBase
Base class for views display plugins.

Namespace

Drupal\views\Plugin\views\display

Code

public function outputIsEmpty() {
    if (!empty($this->view->result)) {
        return FALSE;
    }
    // Check whether all of the area handlers are empty.
    foreach ([
        'empty',
        'footer',
        'header',
    ] as $type) {
        $handlers = $this->getHandlers($type);
        foreach ($handlers as $handler) {
            // If one is not empty, return FALSE now.
            if (!$handler->isEmpty()) {
                return FALSE;
            }
        }
    }
    return TRUE;
}

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