You are here

protected function LingotekConfigMetadata::getMapperIdForName in Lingotek Translation 8

Same name and namespace in other branches
  1. 8.2 src/Entity/LingotekConfigMetadata.php \Drupal\lingotek\Entity\LingotekConfigMetadata::getMapperIdForName()
  2. 4.0.x src/Entity/LingotekConfigMetadata.php \Drupal\lingotek\Entity\LingotekConfigMetadata::getMapperIdForName()
  3. 3.0.x src/Entity/LingotekConfigMetadata.php \Drupal\lingotek\Entity\LingotekConfigMetadata::getMapperIdForName()
  4. 3.1.x src/Entity/LingotekConfigMetadata.php \Drupal\lingotek\Entity\LingotekConfigMetadata::getMapperIdForName()
  5. 3.2.x src/Entity/LingotekConfigMetadata.php \Drupal\lingotek\Entity\LingotekConfigMetadata::getMapperIdForName()
  6. 3.3.x src/Entity/LingotekConfigMetadata.php \Drupal\lingotek\Entity\LingotekConfigMetadata::getMapperIdForName()
  7. 3.4.x src/Entity/LingotekConfigMetadata.php \Drupal\lingotek\Entity\LingotekConfigMetadata::getMapperIdForName()
  8. 3.5.x src/Entity/LingotekConfigMetadata.php \Drupal\lingotek\Entity\LingotekConfigMetadata::getMapperIdForName()
  9. 3.6.x src/Entity/LingotekConfigMetadata.php \Drupal\lingotek\Entity\LingotekConfigMetadata::getMapperIdForName()
  10. 3.7.x src/Entity/LingotekConfigMetadata.php \Drupal\lingotek\Entity\LingotekConfigMetadata::getMapperIdForName()
  11. 3.8.x src/Entity/LingotekConfigMetadata.php \Drupal\lingotek\Entity\LingotekConfigMetadata::getMapperIdForName()

Gets the mapper plugin id for a given configuration name.

Parameters

$name: Configuration name.

Return value

string|null Plugin id of the mapper.

1 call to LingotekConfigMetadata::getMapperIdForName()
LingotekConfigMetadata::getConfigMapper in src/Entity/LingotekConfigMetadata.php
Gets the config mapper for this metadata.

File

src/Entity/LingotekConfigMetadata.php, line 214

Class

LingotekConfigMetadata
Defines the Lingotek config metadata entity.

Namespace

Drupal\lingotek\Entity

Code

protected function getMapperIdForName($name) {
  $mapper_id = NULL;

  /** @var ConfigMapperInterface[] $config_mappers */
  $config_mappers = \Drupal::service('plugin.manager.config_translation.mapper')
    ->getMappers();
  foreach ($config_mappers as $config_mapper_id => $config_mapper) {
    $names = $config_mapper
      ->getConfigNames();
    if (in_array($name, $names)) {
      $mapper_id = $config_mapper_id;
      break;
    }
  }
  return $mapper_id;
}