You are here

public function LingotekConfigMetadata::getDependencyName in Lingotek Translation 8

Same name and namespace in other branches
  1. 8.2 src/Entity/LingotekConfigMetadata.php \Drupal\lingotek\Entity\LingotekConfigMetadata::getDependencyName()
  2. 4.0.x src/Entity/LingotekConfigMetadata.php \Drupal\lingotek\Entity\LingotekConfigMetadata::getDependencyName()
  3. 3.0.x src/Entity/LingotekConfigMetadata.php \Drupal\lingotek\Entity\LingotekConfigMetadata::getDependencyName()
  4. 3.1.x src/Entity/LingotekConfigMetadata.php \Drupal\lingotek\Entity\LingotekConfigMetadata::getDependencyName()
  5. 3.2.x src/Entity/LingotekConfigMetadata.php \Drupal\lingotek\Entity\LingotekConfigMetadata::getDependencyName()
  6. 3.3.x src/Entity/LingotekConfigMetadata.php \Drupal\lingotek\Entity\LingotekConfigMetadata::getDependencyName()
  7. 3.4.x src/Entity/LingotekConfigMetadata.php \Drupal\lingotek\Entity\LingotekConfigMetadata::getDependencyName()
  8. 3.5.x src/Entity/LingotekConfigMetadata.php \Drupal\lingotek\Entity\LingotekConfigMetadata::getDependencyName()
  9. 3.6.x src/Entity/LingotekConfigMetadata.php \Drupal\lingotek\Entity\LingotekConfigMetadata::getDependencyName()
  10. 3.7.x src/Entity/LingotekConfigMetadata.php \Drupal\lingotek\Entity\LingotekConfigMetadata::getDependencyName()
  11. 3.8.x src/Entity/LingotekConfigMetadata.php \Drupal\lingotek\Entity\LingotekConfigMetadata::getDependencyName()
2 calls to LingotekConfigMetadata::getDependencyName()
LingotekConfigMetadata::calculateDependencies in src/Entity/LingotekConfigMetadata.php
Calculates dependencies and stores them in the dependency property.
LingotekConfigMetadata::getConfigMapper in src/Entity/LingotekConfigMetadata.php
Gets the config mapper for this metadata.

File

src/Entity/LingotekConfigMetadata.php, line 162

Class

LingotekConfigMetadata
Defines the Lingotek config metadata entity.

Namespace

Drupal\lingotek\Entity

Code

public function getDependencyName() {
  list($entity_type, $entity_id) = explode('.', $this->config_name, 2);
  if ($entity_type === 'field_config') {
    $field_config = FieldConfig::load($entity_id);
    $value = $field_config
      ->getConfigDependencyName();
  }
  else {
    if ($this
      ->entityManager()
      ->hasDefinition($entity_type)) {
      $storage = $this
        ->entityManager()
        ->getStorage($entity_type);
      $entity = $storage
        ->load($entity_id);
      $value = $entity ? $entity
        ->getConfigDependencyName() : $this->config_name;
    }
    else {
      $value = $this->config_name;
    }
  }
  return $value;
}