View::calculateDependencies

public View::calculateDependencies()

Calculates dependencies and stores them in the dependency property.

Return value

$this

Overrides ConfigEntityBase::calculateDependencies

See also

\Drupal\Core\Config\Entity\ConfigDependencyManager

File

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

Class

View
Defines a View configuration entity class.

Namespace

Drupal\views\Entity

Code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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;
}
doc_Drupal
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.