public function LingotekConfigTranslationService::setDocumentId in Lingotek Translation 8
Same name and namespace in other branches
- 8.2 src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::setDocumentId()
- 4.0.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::setDocumentId()
- 3.0.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::setDocumentId()
- 3.1.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::setDocumentId()
- 3.2.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::setDocumentId()
- 3.3.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::setDocumentId()
- 3.4.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::setDocumentId()
- 3.5.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::setDocumentId()
- 3.6.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::setDocumentId()
- 3.7.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::setDocumentId()
- 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
1 call to LingotekConfigTranslationService::setDocumentId()
- LingotekConfigTranslationService::uploadDocument in src/
LingotekConfigTranslationService.php - Uploads a document to the Lingotek service.
File
- src/
LingotekConfigTranslationService.php, line 181 - Contains \Drupal\lingotek\LingotekConfigTranslationService.
Class
- LingotekConfigTranslationService
- Service for managing Lingotek configuration translations.
Namespace
Drupal\lingotekCode
public function setDocumentId(ConfigEntityInterface &$entity, $document_id) {
$metadata = LingotekConfigMetadata::loadByConfigName($entity
->getEntityTypeId() . '.' . $entity
->id());
$metadata
->setDocumentId($document_id)
->save();
return $entity;
}