public function LingotekInterfaceTranslationService::loadByDocumentId in Lingotek Translation 4.0.x
Same name and namespace in other branches
- 3.2.x src/LingotekInterfaceTranslationService.php \Drupal\lingotek\LingotekInterfaceTranslationService::loadByDocumentId()
- 3.3.x src/LingotekInterfaceTranslationService.php \Drupal\lingotek\LingotekInterfaceTranslationService::loadByDocumentId()
- 3.4.x src/LingotekInterfaceTranslationService.php \Drupal\lingotek\LingotekInterfaceTranslationService::loadByDocumentId()
- 3.5.x src/LingotekInterfaceTranslationService.php \Drupal\lingotek\LingotekInterfaceTranslationService::loadByDocumentId()
- 3.6.x src/LingotekInterfaceTranslationService.php \Drupal\lingotek\LingotekInterfaceTranslationService::loadByDocumentId()
- 3.7.x src/LingotekInterfaceTranslationService.php \Drupal\lingotek\LingotekInterfaceTranslationService::loadByDocumentId()
- 3.8.x src/LingotekInterfaceTranslationService.php \Drupal\lingotek\LingotekInterfaceTranslationService::loadByDocumentId()
Loads the component with the given document id.
Parameters
string $document_id: The document id.
Return value
string The component with the given document id.
Overrides LingotekInterfaceTranslationServiceInterface::loadByDocumentId
File
- src/
LingotekInterfaceTranslationService.php, line 953
Class
- LingotekInterfaceTranslationService
- Service for managing Lingotek interface translations.
Namespace
Drupal\lingotekCode
public function loadByDocumentId($document_id) {
$state = \Drupal::state();
$translations_metadata = $state
->get('lingotek.interface_translations_metadata');
if ($translations_metadata) {
foreach ($translations_metadata as $component => $componentMetadata) {
if ($componentMetadata['document_id'] === $document_id) {
return $component;
}
}
}
return NULL;
}