You are here

public function LingotekConfigTranslationService::setConfigTargetStatus in Lingotek Translation 8

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

Sets the translation status of all translations of a given entity.

Parameters

ConfigNamesMapper $mapper: The entity which status we want to change.

string $locale: Lingotek translation language which we want to get.

int $status: Status of the translation. Use Lingotek constants.

Return value

ConfigEntityInterface

Overrides LingotekConfigTranslationServiceInterface::setConfigTargetStatus

7 calls to LingotekConfigTranslationService::setConfigTargetStatus()
LingotekConfigTranslationService::addConfigTarget in src/LingotekConfigTranslationService.php
Request a translation for a given entity in the given locale.
LingotekConfigTranslationService::checkConfigTargetStatus in src/LingotekConfigTranslationService.php
Checks the status of the translation in the Lingotek service.
LingotekConfigTranslationService::checkConfigTargetStatuses in src/LingotekConfigTranslationService.php
Checks the status of the translations in the Lingotek service.
LingotekConfigTranslationService::downloadConfig in src/LingotekConfigTranslationService.php
Downloads a document to the Lingotek service.
LingotekConfigTranslationService::markConfigTranslationsAsDirty in src/LingotekConfigTranslationService.php
Marks the translation status as dirty if they exist.

... See full list

File

src/LingotekConfigTranslationService.php, line 710
Contains \Drupal\lingotek\LingotekConfigTranslationService.

Class

LingotekConfigTranslationService
Service for managing Lingotek configuration translations.

Namespace

Drupal\lingotek

Code

public function setConfigTargetStatus(ConfigNamesMapper $mapper, $langcode, $status, $save = TRUE) {
  foreach ($mapper
    ->getConfigNames() as $config_name) {
    $metadata = LingotekConfigMetadata::loadByConfigName($config_name);
    $target_status = $metadata
      ->getTargetStatus();
    $target_status[$langcode] = $status;
    $metadata
      ->setTargetStatus($target_status);
    $metadata
      ->save();
  }
}