You are here

public function LingotekContentTranslationService::getDocumentId in Lingotek Translation 3.2.x

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

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

Parameters

\Drupal\Core\Entity\ContentEntityInterface &$entity: The entity which we want the document id.

Return value

string The document id in the Lingotek platform.

Overrides LingotekContentTranslationServiceInterface::getDocumentId

14 calls to LingotekContentTranslationService::getDocumentId()
LingotekContentTranslationService::addTarget in src/LingotekContentTranslationService.php
Request a translation for a given entity in the given locale.
LingotekContentTranslationService::cancelDocument in src/LingotekContentTranslationService.php
Cancels a document from the server.
LingotekContentTranslationService::cancelDocumentTarget in src/LingotekContentTranslationService.php
Cancels a translation for a given entity in the given locale.
LingotekContentTranslationService::checkSourceStatus in src/LingotekContentTranslationService.php
Checks the source is uploaded correctly.
LingotekContentTranslationService::checkTargetStatus in src/LingotekContentTranslationService.php
Gets the current status of the target translation.

... See full list

File

src/LingotekContentTranslationService.php, line 439

Class

LingotekContentTranslationService
Service for managing Lingotek content translations.

Namespace

Drupal\lingotek

Code

public function getDocumentId(ContentEntityInterface &$entity) {
  $doc_id = NULL;
  $metadata = $entity
    ->hasField('lingotek_metadata') ? $entity->lingotek_metadata->entity : NULL;
  if ($metadata !== NULL && $metadata->document_id) {
    $doc_id = $metadata->document_id->value;
  }
  return $doc_id;
}