RdfMapping::calculateDependencies

public RdfMapping::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/rdf/src/Entity/RdfMapping.php, line 137

Class

RdfMapping
Config entity for working with RDF mappings.

Namespace

Drupal\rdf\Entity

Code

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

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

  return $this;
}
doc_Drupal
2016-10-29 09:36:27
Comments
Leave a Comment

Please login to continue.