public static function LingotekConfigChunk::loadById in Lingotek Translation 7.4
Same name and namespace in other branches
- 7.3 lib/Drupal/lingotek/LingotekConfigChunk.php \LingotekConfigChunk::loadById()
- 7.5 lib/Drupal/lingotek/LingotekConfigChunk.php \LingotekConfigChunk::loadById()
Factory method for getting a loaded LingotekConfigChunk object.
Parameters
int $chunk_id: A Drupal config chunk ID.
Return value
mixed A loaded LingotekConfigChunk object if found, FALSE if the chunk could not be loaded.
5 calls to LingotekConfigChunk::loadById()
- LingotekConfigChunk::loadByLingotekDocumentId in lib/
Drupal/ lingotek/ LingotekConfigChunk.php - Loads a LingotekConfigChunk by Lingotek Document ID.
- LingotekSync::getConfigChunk in lib/
Drupal/ lingotek/ LingotekSync.php - LingotekSync::insertTargetEntriesForAllChunks in lib/
Drupal/ lingotek/ LingotekSync.php - lingotek_get_and_update_target_progress in ./
lingotek.sync.inc - Updates the 'target_sync_progress_[lang-code]' field for every target in the lingotek table with the overall progress returned by TMS
- lingotek_sync_download_chunk_target in ./
lingotek.batch.inc
File
- lib/
Drupal/ lingotek/ LingotekConfigChunk.php, line 259 - Defines LingotekConfigChunk.
Class
- LingotekConfigChunk
- A class wrapper for Lingotek-specific behavior on ConfigChunks.
Code
public static function loadById($chunk_id) {
$chunk = FALSE;
// get any segments that should be associated with this chunk
// if segments exist, return a LingotekConfigChunk instance
// otherwise, return FALSE
$chunk_segments = self::getAllSegments($chunk_id);
if ($chunk_segments) {
$chunk = new LingotekConfigChunk($chunk_id);
$chunk
->setApi(LingotekApi::instance());
}
return $chunk;
}