You are here

public function ConfigTest::calculateDependencies in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/config/tests/config_test/src/Entity/ConfigTest.php \Drupal\config_test\Entity\ConfigTest::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/config/tests/config_test/src/Entity/ConfigTest.php, line 128

Class

ConfigTest
Defines the ConfigTest configuration entity.

Namespace

Drupal\config_test\Entity

Code

public function calculateDependencies() {
  parent::calculateDependencies();
  if ($module = \Drupal::state()
    ->get('config_test_new_dependency', FALSE)) {
    $this
      ->addDependency('module', $module);
  }
  return $this;
}