public function LingotekConfigurationService::setConfigProfile in Lingotek Translation 3.8.x
Same name and namespace in other branches
- 8.2 src/LingotekConfigurationService.php \Drupal\lingotek\LingotekConfigurationService::setConfigProfile()
- 4.0.x src/LingotekConfigurationService.php \Drupal\lingotek\LingotekConfigurationService::setConfigProfile()
- 3.0.x src/LingotekConfigurationService.php \Drupal\lingotek\LingotekConfigurationService::setConfigProfile()
- 3.1.x src/LingotekConfigurationService.php \Drupal\lingotek\LingotekConfigurationService::setConfigProfile()
- 3.2.x src/LingotekConfigurationService.php \Drupal\lingotek\LingotekConfigurationService::setConfigProfile()
- 3.3.x src/LingotekConfigurationService.php \Drupal\lingotek\LingotekConfigurationService::setConfigProfile()
- 3.4.x src/LingotekConfigurationService.php \Drupal\lingotek\LingotekConfigurationService::setConfigProfile()
- 3.5.x src/LingotekConfigurationService.php \Drupal\lingotek\LingotekConfigurationService::setConfigProfile()
- 3.6.x src/LingotekConfigurationService.php \Drupal\lingotek\LingotekConfigurationService::setConfigProfile()
- 3.7.x src/LingotekConfigurationService.php \Drupal\lingotek\LingotekConfigurationService::setConfigProfile()
File
- src/
LingotekConfigurationService.php, line 265
Class
- LingotekConfigurationService
- Service for managing lingotek configuration.
Namespace
Drupal\lingotekCode
public function setConfigProfile($mapper_id, $profile_id, $save = TRUE) {
/** @var \Drupal\config_translation\ConfigMapperManager $mapper_manager */
$mapper_manager = \Drupal::service('plugin.manager.config_translation.mapper');
$mappers = $mapper_manager
->getMappers();
$mapper = $mappers[$mapper_id];
$config_names = $mapper
->getConfigNames();
foreach ($config_names as $config_name) {
$metadata = LingotekConfigMetadata::loadByConfigName($config_name);
$metadata
->setProfile($profile_id);
$metadata
->save();
}
return $mapper;
}