You are here

protected function LingotekConfigTranslationService::clearConfigTargetStatuses in Lingotek Translation 3.4.x

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

Clear the target statuses.

Parameters

string $mapper_id:

1 call to LingotekConfigTranslationService::clearConfigTargetStatuses()
LingotekConfigTranslationService::checkConfigTargetStatuses in src/LingotekConfigTranslationService.php
Checks the status of the translations in the Lingotek service.

File

src/LingotekConfigTranslationService.php, line 1297

Class

LingotekConfigTranslationService
Service for managing Lingotek configuration translations.

Namespace

Drupal\lingotek

Code

protected function clearConfigTargetStatuses($mapper_id) {
  $mapper = $this->mappers[$mapper_id];
  $profile = $this->lingotekConfiguration
    ->getConfigProfile($mapper_id);
  if ($profile
    ->id() === Lingotek::PROFILE_DISABLED || $this
    ->getConfigSourceStatus($mapper) === Lingotek::STATUS_CANCELLED) {
    return FALSE;
  }
  foreach ($mapper
    ->getConfigNames() as $config_name) {
    $metadata = LingotekConfigMetadata::loadByConfigName($config_name);
    $metadata
      ->setTargetStatus([])
      ->save();
  }
}