You are here

public function View::calculateDependencies in Drupal 10

Same name in this branch
  1. 10 core/modules/views/src/Entity/View.php \Drupal\views\Entity\View::calculateDependencies()
  2. 10 core/modules/views/src/Plugin/views/area/View.php \Drupal\views\Plugin\views\area\View::calculateDependencies()
Same name and namespace in other branches
  1. 8 core/modules/views/src/Plugin/views/area/View.php \Drupal\views\Plugin\views\area\View::calculateDependencies()
  2. 9 core/modules/views/src/Plugin/views/area/View.php \Drupal\views\Plugin\views\area\View::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;
}