You are here

public function LingotekInterfaceTranslationService::updateEntityHash in Lingotek Translation 3.6.x

Same name and namespace in other branches
  1. 4.0.x src/LingotekInterfaceTranslationService.php \Drupal\lingotek\LingotekInterfaceTranslationService::updateEntityHash()
  2. 3.2.x src/LingotekInterfaceTranslationService.php \Drupal\lingotek\LingotekInterfaceTranslationService::updateEntityHash()
  3. 3.3.x src/LingotekInterfaceTranslationService.php \Drupal\lingotek\LingotekInterfaceTranslationService::updateEntityHash()
  4. 3.4.x src/LingotekInterfaceTranslationService.php \Drupal\lingotek\LingotekInterfaceTranslationService::updateEntityHash()
  5. 3.5.x src/LingotekInterfaceTranslationService.php \Drupal\lingotek\LingotekInterfaceTranslationService::updateEntityHash()
  6. 3.7.x src/LingotekInterfaceTranslationService.php \Drupal\lingotek\LingotekInterfaceTranslationService::updateEntityHash()
  7. 3.8.x src/LingotekInterfaceTranslationService.php \Drupal\lingotek\LingotekInterfaceTranslationService::updateEntityHash()

Updates the component hash.

Parameters

string $component: The component being checked.

Overrides LingotekInterfaceTranslationServiceInterface::updateEntityHash

File

src/LingotekInterfaceTranslationService.php, line 429

Class

LingotekInterfaceTranslationService
Service for managing Lingotek interface translations.

Namespace

Drupal\lingotek

Code

public function updateEntityHash($component) {
  $source_data = json_encode($this
    ->getSourceData($component));
  $metadata = $this
    ->getMetadata($component);
  if (!empty($metadata)) {
    $metadata['lingotek_hash'] = md5($source_data);
    $this
      ->saveMetadata($component, $metadata);
  }
}