You are here

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

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

Updates the 'initial upload' 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::setLastUploaded

1 call to LingotekConfigTranslationService::setLastUploaded()
LingotekConfigTranslationService::uploadDocument in src/LingotekConfigTranslationService.php
Uploads a document to the Lingotek service.

File

src/LingotekConfigTranslationService.php, line 1809

Class

LingotekConfigTranslationService
Service for managing Lingotek configuration translations.

Namespace

Drupal\lingotek

Code

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