public function LingotekConfigTranslationService::setEnabled in Lingotek Translation 8
Same name and namespace in other branches
- 8.2 src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::setEnabled()
- 4.0.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::setEnabled()
- 3.0.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::setEnabled()
- 3.1.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::setEnabled()
- 3.2.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::setEnabled()
- 3.3.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::setEnabled()
- 3.4.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::setEnabled()
- 3.5.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::setEnabled()
- 3.6.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::setEnabled()
- 3.7.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::setEnabled()
- 3.8.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::setEnabled()
Sets if the given config entity is enabled for Lingotek config translation.
Parameters
string $plugin_id: The config entity plugin id.
bool $enabled: Flag for enabling or disabling this config entity. Defaults to TRUE.
Overrides LingotekConfigTranslationServiceInterface::setEnabled
File
- src/
LingotekConfigTranslationService.php, line 124 - Contains \Drupal\lingotek\LingotekConfigTranslationService.
Class
- LingotekConfigTranslationService
- Service for managing Lingotek configuration translations.
Namespace
Drupal\lingotekCode
public function setEnabled($plugin_id, $enabled = TRUE) {
$config = \Drupal::configFactory()
->getEditable('lingotek.settings');
$key = 'translate.config.' . $plugin_id . '.enabled';
$config
->set($key, $enabled)
->save();
}