You are here

public function LingotekConfigSet::updateLocalContent in Lingotek Translation 7.6

Same name and namespace in other branches
  1. 7.7 lib/Drupal/lingotek/LingotekConfigSet.php \LingotekConfigSet::updateLocalContent()

Updates the local content with data from a Lingotek Document.

Return value

bool TRUE if the content updates succeeded, FALSE otherwise.

1 call to LingotekConfigSet::updateLocalContent()
LingotekConfigSet::contentUpdated in lib/Drupal/lingotek/LingotekConfigSet.php
Event handler for updates to the config set's data.

File

lib/Drupal/lingotek/LingotekConfigSet.php, line 794
Defines LingotekConfigSet.

Class

LingotekConfigSet
A class wrapper for Lingotek-specific behavior on ConfigSets.

Code

public function updateLocalContent() {
  $metadata = $this
    ->metadata();
  $document_id = $metadata['document_id'];
  if (empty($document_id)) {
    LingotekLog::error('Unable to refresh local contents for config set @sid. Could not find Lingotek Document ID.', array(
      '@sid' => $this->sid,
    ));
    return FALSE;
  }
  $api = LingotekApi::instance();
  $document = $api
    ->getDocument($document_id);
  foreach ($document->translationTargets as $target) {
    $this
      ->downloadTriggered($target->lingotek_locale);
  }
}