You are here

public static function LingotekConfigChunk::loadByLingotekDocumentId in Lingotek Translation 7.5

Same name and namespace in other branches
  1. 7.3 lib/Drupal/lingotek/LingotekConfigChunk.php \LingotekConfigChunk::loadByLingotekDocumentId()
  2. 7.4 lib/Drupal/lingotek/LingotekConfigChunk.php \LingotekConfigChunk::loadByLingotekDocumentId()

Loads a LingotekConfigChunk by Lingotek Document ID.

Parameters

string $lingotek_document_id: The Document ID whose corresponding chunk should be loaded.

string $lingotek_language_code: The language code associated with the Lingotek Document ID.

int $lingotek_project_id: The Lingotek project ID associated with the Lingotek Document ID.

Return value

mixed A LingotekConfigChunk object on success, FALSE on failure.

2 calls to LingotekConfigChunk::loadByLingotekDocumentId()
lingotek_get_trans_obj in ./lingotek.sync.inc
lingotek_update_config_progress in ./lingotek.sync.inc
Updates the 'target_sync_status_[lang-code]' field for every target in the lingotek_config_metadata table with the overall progress returned by TMS

File

lib/Drupal/lingotek/LingotekConfigChunk.php, line 415
Defines LingotekConfigChunk.

Class

LingotekConfigChunk
A class wrapper for Lingotek-specific behavior on ConfigChunks.

Code

public static function loadByLingotekDocumentId($lingotek_document_id) {
  $chunk = FALSE;

  // Get the Chunk entries in the system associated with the document ID.
  $query = db_select('{lingotek_config_metadata}', 'meta')
    ->fields('meta', array(
    'id',
  ))
    ->condition('config_key', 'document_id')
    ->condition('value', $lingotek_document_id)
    ->execute();
  $id = $query
    ->fetchField();
  if ($id) {
    $chunk = self::loadById($id);
  }
  return $chunk;
}