function DisplayPluginBase::getRoutedDisplay

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

Overrides DisplayPluginInterface::getRoutedDisplay

1 call to DisplayPluginBase::getRoutedDisplay()
DisplayPluginBase::validate in core/modules/views/src/Plugin/views/display/DisplayPluginBase.php
Validate that the plugin is correct and can be saved.

File

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

Class

DisplayPluginBase
Base class for views display plugins.

Namespace

Drupal\views\Plugin\views\display

Code

public function getRoutedDisplay() {
    // If this display has a route, return this display.
    if ($this instanceof DisplayRouterInterface) {
        return $this;
    }
    // If the display does not have a route (e.g. a block display), get the
    // route for the linked display.
    $display_id = $this->getLinkDisplay();
    if ($display_id && $this->view->displayHandlers
        ->has($display_id) && is_object($this->view->displayHandlers
        ->get($display_id))) {
        return $this->view->displayHandlers
            ->get($display_id)
            ->getRoutedDisplay();
    }
    // No routed display exists, so return NULL
    return NULL;
}

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