You are here

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

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

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

Parameters

\Drupal\Core\Config\Entity\ConfigEntityInterface $entity: The entity which we want the document id.

string $document_id: The document id in the Lingotek platform.

Overrides LingotekConfigTranslationServiceInterface::setDocumentId

6 calls to LingotekConfigTranslationService::setDocumentId()
LingotekConfigTranslationService::addTarget in src/LingotekConfigTranslationService.php
Request a translation for a given entity in the given locale.
LingotekConfigTranslationService::cancelDocument in src/LingotekConfigTranslationService.php
Cancels a document from the server.
LingotekConfigTranslationService::requestTranslations in src/LingotekConfigTranslationService.php
Requests translations of a document in all the enabled locales.
LingotekConfigTranslationService::setJobId in src/LingotekConfigTranslationService.php
Sets the job ID of a given entity.
LingotekConfigTranslationService::updateDocument in src/LingotekConfigTranslationService.php
Resends a document to the translation service.

... See full list

File

src/LingotekConfigTranslationService.php, line 170

Class

LingotekConfigTranslationService
Service for managing Lingotek configuration translations.

Namespace

Drupal\lingotek

Code

public function setDocumentId(ConfigEntityInterface &$entity, $document_id) {
  $metadata = LingotekConfigMetadata::loadByConfigName($entity
    ->getEntityTypeId() . '.' . $entity
    ->id());
  $metadata
    ->setDocumentId($document_id)
    ->save();
  return $entity;
}