You are here

public function LingotekConfigTranslationService::setConfigTargetStatus in Lingotek Translation 3.4.x

Same name and namespace in other branches
  1. 8 src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::setConfigTargetStatus()
  2. 8.2 src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::setConfigTargetStatus()
  3. 4.0.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::setConfigTargetStatus()
  4. 3.0.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::setConfigTargetStatus()
  5. 3.1.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::setConfigTargetStatus()
  6. 3.2.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::setConfigTargetStatus()
  7. 3.3.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

\Drupal\config_translation\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

\Drupal\Core\Config\ConfigEntityInterface

Overrides LingotekConfigTranslationServiceInterface::setConfigTargetStatus

8 calls to LingotekConfigTranslationService::setConfigTargetStatus()
LingotekConfigTranslationService::addConfigTarget in src/LingotekConfigTranslationService.php
Request a translation for a given entity in the given locale.
LingotekConfigTranslationService::cancelConfigDocumentTarget in src/LingotekConfigTranslationService.php
Cancels 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.

... See full list

File

src/LingotekConfigTranslationService.php, line 987

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();
  }
}