You are here

public function LingotekConfigTranslationService::getConfigDocumentId in Lingotek Translation 8

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

Gets the document id in the Lingotek platform for a given entity.

Parameters

ConfigNamesMapper $mapper: The entity which we want the document id.

Return value

string The document id in the Lingotek platform.

Overrides LingotekConfigTranslationServiceInterface::getConfigDocumentId

10 calls to LingotekConfigTranslationService::getConfigDocumentId()
LingotekConfigTranslationService::addConfigTarget in src/LingotekConfigTranslationService.php
Request 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.
LingotekConfigTranslationService::deleteConfigDocument in src/LingotekConfigTranslationService.php
Deletes a document from the server and all related local data.

... See full list

File

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

Class

LingotekConfigTranslationService
Service for managing Lingotek configuration translations.

Namespace

Drupal\lingotek

Code

public function getConfigDocumentId(ConfigNamesMapper $mapper) {
  $document_id = NULL;
  $metadata = NULL;
  foreach ($mapper
    ->getConfigNames() as $config_name) {
    $metadata = LingotekConfigMetadata::loadByConfigName($config_name);
    break;
  }
  if ($metadata) {
    $document_id = $metadata
      ->getDocumentId();
  }
  return $document_id;
}