function DisplayPluginBase::outputIsEmpty

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

File

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

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.