You are here

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

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

Sets the translation status of a given entity.

Parameters

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

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

Return value

\Drupal\Core\Config\ConfigEntityInterface

Overrides LingotekConfigTranslationServiceInterface::setConfigSourceStatus

7 calls to LingotekConfigTranslationService::setConfigSourceStatus()
LingotekConfigTranslationService::addConfigTarget in src/LingotekConfigTranslationService.php
Request a translation for a given entity in the given locale.
LingotekConfigTranslationService::cancelConfigDocument in src/LingotekConfigTranslationService.php
Cancels a document from the server.
LingotekConfigTranslationService::checkConfigSourceStatus in src/LingotekConfigTranslationService.php
Checks the source is uploaded correctly.
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.

... See full list

File

src/LingotekConfigTranslationService.php, line 944

Class

LingotekConfigTranslationService
Service for managing Lingotek configuration translations.

Namespace

Drupal\lingotek

Code

public function setConfigSourceStatus(ConfigNamesMapper $mapper, $status) {
  $config_names = $mapper
    ->getConfigNames();
  $source_language = $mapper
    ->getLangcode();
  $status_value = [
    $source_language => $status,
  ];
  foreach ($config_names as $config_name) {
    $metadata = LingotekConfigMetadata::loadByConfigName($config_name);
    $metadata
      ->setSourceStatus($status_value);
    $metadata
      ->save();
  }
}