public function LingotekContentTranslationService::loadByDocumentId in Lingotek Translation 3.4.x
Same name and namespace in other branches
- 8 src/LingotekContentTranslationService.php \Drupal\lingotek\LingotekContentTranslationService::loadByDocumentId()
- 8.2 src/LingotekContentTranslationService.php \Drupal\lingotek\LingotekContentTranslationService::loadByDocumentId()
- 4.0.x src/LingotekContentTranslationService.php \Drupal\lingotek\LingotekContentTranslationService::loadByDocumentId()
- 3.0.x src/LingotekContentTranslationService.php \Drupal\lingotek\LingotekContentTranslationService::loadByDocumentId()
- 3.1.x src/LingotekContentTranslationService.php \Drupal\lingotek\LingotekContentTranslationService::loadByDocumentId()
- 3.2.x src/LingotekContentTranslationService.php \Drupal\lingotek\LingotekContentTranslationService::loadByDocumentId()
- 3.3.x src/LingotekContentTranslationService.php \Drupal\lingotek\LingotekContentTranslationService::loadByDocumentId()
- 3.5.x src/LingotekContentTranslationService.php \Drupal\lingotek\LingotekContentTranslationService::loadByDocumentId()
- 3.6.x src/LingotekContentTranslationService.php \Drupal\lingotek\LingotekContentTranslationService::loadByDocumentId()
- 3.7.x src/LingotekContentTranslationService.php \Drupal\lingotek\LingotekContentTranslationService::loadByDocumentId()
- 3.8.x src/LingotekContentTranslationService.php \Drupal\lingotek\LingotekContentTranslationService::loadByDocumentId()
Loads the entity with the given document id.
Parameters
string $document_id: The document id.
Return value
\Drupal\Core\Entity\ContentEntityInterface The entity with the given document id.
Overrides LingotekContentTranslationServiceInterface::loadByDocumentId
File
- src/
LingotekContentTranslationService.php, line 1393
Class
- LingotekContentTranslationService
- Service for managing Lingotek content translations.
Namespace
Drupal\lingotekCode
public function loadByDocumentId($document_id) {
$entity = NULL;
$metadata = LingotekContentMetadata::loadByDocumentID($document_id);
if ($metadata && $metadata
->getContentEntityTypeId() && $metadata
->getContentEntityId()) {
$entity = $this->entityTypeManager
->getStorage($metadata
->getContentEntityTypeId())
->load($metadata
->getContentEntityId());
}
return $entity;
}