protected function LingotekContentTranslationService::storeUploadProcessId in Lingotek Translation 3.7.x
Same name and namespace in other branches
- 4.0.x src/LingotekContentTranslationService.php \Drupal\lingotek\LingotekContentTranslationService::storeUploadProcessId()
- 3.8.x src/LingotekContentTranslationService.php \Drupal\lingotek\LingotekContentTranslationService::storeUploadProcessId()
Stores the upload process id.
In case of 404, we need to know if there was an error, or it's just still importing.
Parameters
\Drupal\Core\Entity\ContentEntityInterface $entity: The entity being imported.
string $process_id: The process ID in the TMS.
2 calls to LingotekContentTranslationService::storeUploadProcessId()
- 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 2479
Class
- LingotekContentTranslationService
- Service for managing Lingotek content translations.
Namespace
Drupal\lingotekCode
protected function storeUploadProcessId(ContentEntityInterface $entity, $process_id) {
$state = \Drupal::state();
$stored_process_ids = $state
->get('lingotek_import_process_ids', []);
$parents = [
$entity
->getEntityTypeId(),
$entity
->id(),
];
NestedArray::setValue($stored_process_ids, $parents, $process_id);
$state
->set('lingotek_import_process_ids', $stored_process_ids);
}