public function LingotekContentTranslationService::getLastUpdated in Lingotek Translation 3.6.x
Same name and namespace in other branches
- 4.0.x src/LingotekContentTranslationService.php \Drupal\lingotek\LingotekContentTranslationService::getLastUpdated()
- 3.4.x src/LingotekContentTranslationService.php \Drupal\lingotek\LingotekContentTranslationService::getLastUpdated()
- 3.5.x src/LingotekContentTranslationService.php \Drupal\lingotek\LingotekContentTranslationService::getLastUpdated()
- 3.7.x src/LingotekContentTranslationService.php \Drupal\lingotek\LingotekContentTranslationService::getLastUpdated()
- 3.8.x src/LingotekContentTranslationService.php \Drupal\lingotek\LingotekContentTranslationService::getLastUpdated()
Gets the 'updated date' time metadata for the given entity.
Parameters
\Drupal\Core\Entity\ContentEntityInterface $entity: The entity which we want the document id.
Return value
\Drupal\Core\Entity\ContentEntityInterface Returns the timestamp.
Overrides LingotekContentTranslationServiceInterface::getLastUpdated
1 call to LingotekContentTranslationService::getLastUpdated()
- LingotekContentTranslationService::checkForTimeout in src/
LingotekContentTranslationService.php - Checks the time elapsed since the last upload and sets the entity to error if the max time has elapsed.
File
- src/
LingotekContentTranslationService.php, line 2304
Class
- LingotekContentTranslationService
- Service for managing Lingotek content translations.
Namespace
Drupal\lingotekCode
public function getLastUpdated(ContentEntityInterface $entity) {
if (!$entity->lingotek_metadata->entity) {
$entity->lingotek_metadata->entity = LingotekContentMetadata::loadByTargetId($entity
->getEntityTypeId(), $entity
->id());
}
/** @var \Drupal\lingotek\Entity\LingotekContentMetadata $metadata */
$metadata = $entity->lingotek_metadata->entity;
return $metadata
->getLastUpdated();
}