public function LingotekConfigChunk::updateLocalContent in Lingotek Translation 7.5
Same name and namespace in other branches
- 7.3 lib/Drupal/lingotek/LingotekConfigChunk.php \LingotekConfigChunk::updateLocalContent()
- 7.4 lib/Drupal/lingotek/LingotekConfigChunk.php \LingotekConfigChunk::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 LingotekConfigChunk::updateLocalContent()
- LingotekConfigChunk::contentUpdated in lib/
Drupal/ lingotek/ LingotekConfigChunk.php - Event handler for updates to the config chunk's data.
File
- lib/
Drupal/ lingotek/ LingotekConfigChunk.php, line 686 - Defines LingotekConfigChunk.
Class
- LingotekConfigChunk
- A class wrapper for Lingotek-specific behavior on ConfigChunks.
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 chunk @cid. Could not find Lingotek Document ID.', array(
'@cid' => $this->cid,
));
return FALSE;
}
$api = LingotekApi::instance();
$document = $api
->getDocument($document_id);
foreach ($document->translationTargets as $target) {
$this
->downloadTriggered($target->lingotek_locale);
}
}