You are here

public function HierarchyEmbed::execute in Entity Reference Hierarchy 8

The display block handler returns the structure necessary for a block.

Overrides DisplayPluginBase::execute

File

entity_hierarchy_views/src/Plugin/views/display/HierarchyEmbed.php, line 99
Contains \Drupal\entity_hierarchy_views\Plugin\views\display\HierarchyEmbed.

Class

HierarchyEmbed
The plugin that handles an HierarchyEmbed display.

Namespace

Drupal\entity_hierarchy_views\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.
  parent::execute();
  if (!isset($this->view->override_path)) {
    $this->view->override_path = 'node';
  }
  $data = $this->view
    ->render();
  if (!empty($this->view->result) || $this
    ->getOption('empty') || !empty($this->view->style_plugin->definition['even empty'])) {
    return $data;
  }
}