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.9.x core/modules/views/src/Entity/View.php \Drupal\views\Entity\View::calculateDependencies()
  2. 9 core/modules/views/src/Entity/View.php \Drupal\views\Entity\View::calculateDependencies()

Calculates dependencies and stores them in the dependency property.

Return value

$this

Overrides ConfigEntityBase::calculateDependencies

See also

\Drupal\Core\Config\Entity\ConfigDependencyManager

1 call to View::calculateDependencies()
View::onDependencyRemoval in core/modules/views/src/Entity/View.php
Informs the entity that entities it depends on will be deleted.

File

core/modules/views/src/Entity/View.php, line 271

Class

View
Defines a View configuration entity class.

Namespace

Drupal\views\Entity

Code

public function calculateDependencies() {
  parent::calculateDependencies();

  // Ensure that the view is dependant on the module that implements the view.
  $this
    ->addDependency('module', $this->module);
  $executable = $this
    ->getExecutable();
  $executable
    ->initDisplay();
  $executable
    ->initStyle();
  foreach ($executable->displayHandlers as $display) {

    // Calculate the dependencies each display has.
    $this
      ->calculatePluginDependencies($display);
  }
  return $this;
}