You are here

public function LingotekConfigTranslationService::getConfigSourceStatus in Lingotek Translation 8

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

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

Return value

int Status of the source. Use Lingotek class constants.

Overrides LingotekConfigTranslationServiceInterface::getConfigSourceStatus

4 calls to LingotekConfigTranslationService::getConfigSourceStatus()
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::downloadConfig in src/LingotekConfigTranslationService.php
Downloads a document to the Lingotek service.
LingotekConfigTranslationService::requestConfigTranslations in src/LingotekConfigTranslationService.php
Request all translations for a given mapper in all locales.

File

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

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