You are here

public function LingotekConfigSet::updateLocalContent in Lingotek Translation 7.7

Same name and namespace in other branches
  1. 7.6 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.

File

lib/Drupal/lingotek/LingotekConfigSet.php, line 847
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);
  }
}