You are here

public function LingotekContentTranslationService::getJobId in Lingotek Translation 3.7.x

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

Gets the job ID of a given entity.

Parameters

\Drupal\Core\Entity\ContentEntityInterface $entity: The entity we want to get the job id.

Return value

string Returns the job ID is saved.

Overrides LingotekContentTranslationServiceInterface::getJobId

3 calls to LingotekContentTranslationService::getJobId()
LingotekContentTranslationService::setJobId in src/LingotekContentTranslationService.php
Sets the job ID of a given entity.
LingotekContentTranslationService::updateDocument in src/LingotekContentTranslationService.php
Resends a document to the translation service.
LingotekContentTranslationService::uploadDocument in src/LingotekContentTranslationService.php
Uploads a document to the Lingotek service.

File

src/LingotekContentTranslationService.php, line 2257

Class

LingotekContentTranslationService
Service for managing Lingotek content translations.

Namespace

Drupal\lingotek

Code

public function getJobId(ContentEntityInterface $entity) {
  $job_id = NULL;
  if (!empty($entity
    ->get('lingotek_metadata')->target_id)) {

    /** @var \Drupal\lingotek\Entity\LingotekContentMetadata $metadata */
    $metadata = $entity->lingotek_metadata->entity;
    $job_id = $metadata
      ->getJobId();
  }
  return $job_id;
}