You are here

function Eva::execute in EVA: Entity Views Attachment 8

Same name and namespace in other branches
  1. 8.2 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 271

Class

Eva
The plugin that handles an EVA display in views.

Namespace

Drupal\eva\Plugin\views\display

Code

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 = \Drupal::service('path.current')
      ->getPath();
  }
  $element = $this->view
    ->render();
  if (!empty($this->view->result) || $this
    ->getOption('empty') || !empty($this->view->style_plugin->definition['even empty'])) {
    return $element;
  }
  return [];
}