function View::calculateDependencies

Same name in this branch
  1. 11.x core/modules/views/src/Entity/View.php \Drupal\views\Entity\View::calculateDependencies()
Same name in other branches
  1. 9 core/modules/views/src/Entity/View.php \Drupal\views\Entity\View::calculateDependencies()
  2. 9 core/modules/views/src/Plugin/views/area/View.php \Drupal\views\Plugin\views\area\View::calculateDependencies()
  3. 8.9.x core/modules/views/src/Entity/View.php \Drupal\views\Entity\View::calculateDependencies()
  4. 8.9.x core/modules/views/src/Plugin/views/area/View.php \Drupal\views\Plugin\views\area\View::calculateDependencies()
  5. 10 core/modules/views/src/Entity/View.php \Drupal\views\Entity\View::calculateDependencies()
  6. 10 core/modules/views/src/Plugin/views/area/View.php \Drupal\views\Plugin\views\area\View::calculateDependencies()

Overrides HandlerBase::calculateDependencies

File

core/modules/views/src/Plugin/views/area/View.php, line 152

Class

View
Views area handlers. Insert a view inside of an area.

Namespace

Drupal\views\Plugin\views\area

Code

public function calculateDependencies() {
    $dependencies = parent::calculateDependencies();
    [
        $view_id,
    ] = explode(':', $this->options['view_to_insert'], 2);
    // Don't call the current view, as it would result into an infinite recursion.
    if ($view_id && $this->view->storage
        ->id() != $view_id) {
        $view = $this->viewStorage
            ->load($view_id);
        $dependencies[$view->getConfigDependencyKey()][] = $view->getConfigDependencyName();
    }
    return $dependencies;
}

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