You are here

public function LingotekConfigTranslationService::setEnabled in Lingotek Translation 3.1.x

Same name and namespace in other branches
  1. 8 src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::setEnabled()
  2. 8.2 src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::setEnabled()
  3. 4.0.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::setEnabled()
  4. 3.0.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::setEnabled()
  5. 3.2.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::setEnabled()
  6. 3.3.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::setEnabled()
  7. 3.4.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::setEnabled()
  8. 3.5.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::setEnabled()
  9. 3.6.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::setEnabled()
  10. 3.7.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::setEnabled()
  11. 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 120

Class

LingotekConfigTranslationService
Service for managing Lingotek configuration translations.

Namespace

Drupal\lingotek

Code

public function setEnabled($plugin_id, $enabled = TRUE) {
  $config = \Drupal::configFactory()
    ->getEditable('lingotek.settings');
  $key = 'translate.config.' . $plugin_id . '.enabled';
  $config
    ->set($key, $enabled)
    ->save();
}