You are here

protected function Translator::updateCache in Translation Management Tool 8

Updates the language cache.

2 calls to Translator::updateCache()
Translator::getSupportedLanguagePairs in src/Entity/Translator.php
Gets the supported language pairs for this translator.
Translator::getSupportedTargetLanguages in src/Entity/Translator.php
Returns the supported target languages for this translator.

File

src/Entity/Translator.php, line 468

Class

Translator
Entity class for the tmgmt_translator entity.

Namespace

Drupal\tmgmt\Entity

Code

protected function updateCache() {
  if ($plugin = $this
    ->getPlugin()) {
    $info = $plugin
      ->getPluginDefinition();
    if (!isset($info['language_cache']) || !empty($info['language_cache'])) {
      \Drupal::cache('data')
        ->set('tmgmt_languages:' . $this->name, $this->languageCache, Cache::PERMANENT, $this
        ->getCacheTags());
      \Drupal::cache('data')
        ->set('tmgmt_language_pairs:' . $this->name, $this->languagePairsCache, Cache::PERMANENT, $this
        ->getCacheTags());
    }
  }
}