You are here

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

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

Gets the source status of a given entity.

Parameters

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

Return value

int Status of the source. Use Lingotek class constants.

Overrides LingotekConfigTranslationServiceInterface::getConfigSourceStatus

10 calls to LingotekConfigTranslationService::getConfigSourceStatus()
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::checkConfigSourceStatus in src/LingotekConfigTranslationService.php
Checks the source is uploaded correctly.
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.

... See full list

File

src/LingotekConfigTranslationService.php, line 927

Class

LingotekConfigTranslationService
Service for managing Lingotek configuration translations.

Namespace

Drupal\lingotek

Code

public function getConfigSourceStatus(ConfigNamesMapper $mapper) {
  $config_names = $mapper
    ->getConfigNames();
  $source_language = $mapper
    ->getLangcode();
  $status = Lingotek::STATUS_UNTRACKED;
  foreach ($config_names as $config_name) {
    $metadata = LingotekConfigMetadata::loadByConfigName($config_name);
    $source_status = $metadata
      ->getSourceStatus();
    if (count($source_status) > 0 && isset($source_status[$source_language])) {
      $status = $source_status[$source_language];
    }
  }
  return $status;
}