You are here

public function Eva::execute in EVA: Entity Views Attachment 8.2

Same name and namespace in other branches
  1. 8 src/Plugin/views/display/Eva.php \Drupal\eva\Plugin\views\display\Eva::execute()

Executes the view and returns data in the format required.

The base class cannot be executed.

Overrides DisplayPluginBase::execute

File

src/Plugin/views/display/Eva.php, line 373

Class

Eva
The plugin that handles an EVA display in views.

Namespace

Drupal\eva\Plugin\views\display

Code

public function execute() {

  // Prior to this being called, the $view should already be set to this
  // display, and arguments should be set on the view.
  if (!isset($this->view->override_path)) {
    $this->view->override_path = $this->currentPathStack
      ->getPath();
  }
  $element = $this->view
    ->render();
  if (!empty($this->view->result) || $this
    ->getOption('empty') || !empty($this->view->style_plugin->definition['even empty'])) {
    return $element;
  }
  return [];
}