You are here

public function DisplayPluginBase::getAttachedDisplays in Zircon Profile 8

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

Find out all displays which are attached to this display.

The method is just using the pure storage object to avoid loading of the sub displays which would kill lazy loading.

Overrides DisplayPluginInterface::getAttachedDisplays

File

core/modules/views/src/Plugin/views/display/DisplayPluginBase.php, line 688
Contains \Drupal\views\Plugin\views\display\DisplayPluginBase.

Class

DisplayPluginBase
Base class for views display plugins.

Namespace

Drupal\views\Plugin\views\display

Code

public function getAttachedDisplays() {
  $current_display_id = $this->display['id'];
  $attached_displays = array();

  // Go through all displays and search displays which link to this one.
  foreach ($this->view->storage
    ->get('display') as $display_id => $display) {
    if (isset($display['display_options']['displays'])) {
      $displays = $display['display_options']['displays'];
      if (isset($displays[$current_display_id])) {
        $attached_displays[] = $display_id;
      }
    }
  }
  return $attached_displays;
}