function DisplayPluginBase::getAttachedDisplays

Same name in other branches
  1. 9 core/modules/views/src/Plugin/views/display/DisplayPluginBase.php \Drupal\views\Plugin\views\display\DisplayPluginBase::getAttachedDisplays()
  2. 10 core/modules/views/src/Plugin/views/display/DisplayPluginBase.php \Drupal\views\Plugin\views\display\DisplayPluginBase::getAttachedDisplays()
  3. 11.x core/modules/views/src/Plugin/views/display/DisplayPluginBase.php \Drupal\views\Plugin\views\display\DisplayPluginBase::getAttachedDisplays()

Overrides DisplayPluginInterface::getAttachedDisplays

File

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

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 = [];
    // 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;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.