You are here

public function LingotekConfigTranslationService::setLastUpdated in Lingotek Translation 3.4.x

Same name and namespace in other branches
  1. 4.0.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::setLastUpdated()
  2. 3.5.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::setLastUpdated()
  3. 3.6.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::setLastUpdated()
  4. 3.7.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::setLastUpdated()
  5. 3.8.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::setLastUpdated()

Updates the 'updated date' time metadata to the current request time.

Parameters

\Drupal\Core\Config\Entity\ConfigEntityInterface $entity: The entity to which we want to save the timestamp.

int $timestamp: The timestamp we want to store.

Return value

\Drupal\Core\Config\Entity\ConfigEntityInterface Returns the entity for which timestamp is saved.

Overrides LingotekConfigTranslationServiceInterface::setLastUpdated

1 call to LingotekConfigTranslationService::setLastUpdated()
LingotekConfigTranslationService::updateDocument in src/LingotekConfigTranslationService.php
Resends a document to the translation service.

File

src/LingotekConfigTranslationService.php, line 1819

Class

LingotekConfigTranslationService
Service for managing Lingotek configuration translations.

Namespace

Drupal\lingotek

Code

public function setLastUpdated(ConfigEntityInterface $entity, int $timestamp) {
  $metadata = LingotekConfigMetadata::loadByConfigName($entity
    ->getEntityTypeId() . '.' . $entity
    ->id());
  $metadata
    ->setLastUpdated($timestamp)
    ->save();
  return $entity;
}