You are here

public function LingotekConfigTranslationService::updateConfig in Lingotek Translation 8

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

Resends a document to the translation service.

Parameters

$mapper_id: The entity being updated.

Return value

boolean TRUE if the document was updated successfully, FALSE if not.

Overrides LingotekConfigTranslationServiceInterface::updateConfig

1 call to LingotekConfigTranslationService::updateConfig()
LingotekConfigTranslationService::uploadConfig in src/LingotekConfigTranslationService.php
Uploads a document to the Lingotek service.

File

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

Class

LingotekConfigTranslationService
Service for managing Lingotek configuration translations.

Namespace

Drupal\lingotek

Code

public function updateConfig($mapper_id) {
  $mapper = $this->mappers[$mapper_id];
  $source_data = json_encode($this
    ->getConfigSourceData($mapper));
  $document_id = $this
    ->getConfigDocumentId($mapper);
  $document_name = $mapper_id . ' (config): ' . $mapper
    ->getTitle();
  if ($this->lingotek
    ->updateDocument($document_id, $source_data, NULL, $document_name)) {
    $this
      ->setConfigSourceStatus($mapper, Lingotek::STATUS_IMPORTING);
    $this
      ->setConfigTargetStatuses($mapper, Lingotek::STATUS_PENDING);
    return $document_id;
  }
  return FALSE;
}