You are here

public function ContentLanguageSettings::calculateDependencies in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/language/src/Entity/ContentLanguageSettings.php \Drupal\language\Entity\ContentLanguageSettings::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/language/src/Entity/ContentLanguageSettings.php, line 195
Contains \Drupal\language\Entity\ContentLanguageSettings.

Class

ContentLanguageSettings
Defines the ContentLanguageSettings entity.

Namespace

Drupal\language\Entity

Code

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

  // Create dependency on the bundle.
  $entity_type = \Drupal::entityManager()
    ->getDefinition($this->target_entity_type_id);
  $bundle_config_dependency = $entity_type
    ->getBundleConfigDependency($this->target_bundle);
  $this
    ->addDependency($bundle_config_dependency['type'], $bundle_config_dependency['name']);
  return $this;
}