ContentLanguageSettings::calculateDependencies

public 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 191

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;
}
doc_Drupal
2016-10-29 08:57:49
Comments
Leave a Comment

Please login to continue.