You are here

public function LingotekApi::getTranslationTarget in Lingotek Translation 7.3

Same name and namespace in other branches
  1. 7.7 lib/Drupal/lingotek/LingotekApi.php \LingotekApi::getTranslationTarget()
  2. 7.2 lib/Drupal/lingotek/LingotekApi.php \LingotekApi::getTranslationTarget()
  3. 7.4 lib/Drupal/lingotek/LingotekApi.php \LingotekApi::getTranslationTarget()
  4. 7.5 lib/Drupal/lingotek/LingotekApi.php \LingotekApi::getTranslationTarget()
  5. 7.6 lib/Drupal/lingotek/LingotekApi.php \LingotekApi::getTranslationTarget()

Gets a translation target.

This fetches an target language object for a specific document.

Parameters

int $translation_target_id: ID for the target language object.

Return value

Object representing a target language for a specific document in the Lingotek platform, or FALSE on error.

1 call to LingotekApi::getTranslationTarget()
LingotekApi::currentPhase in lib/Drupal/lingotek/LingotekApi.php
Gets the phase data for the active phase of the specified translation target.

File

lib/Drupal/lingotek/LingotekApi.php, line 581
Defines Drupal\lingotek\LingotekApi

Class

LingotekApi
@file Defines Drupal\lingotek\LingotekApi

Code

public function getTranslationTarget($translation_target_id) {
  $targets =& drupal_static(__FUNCTION__);
  $params = array(
    'translationTargetId' => $translation_target_id,
  );
  if (isset($targets[$translation_target_id])) {
    return $targets[$translation_target_id];
  }
  elseif ($output = $this
    ->request('getTranslationTarget', $params)) {
    $targets[$translation_target_id] = $output;
    return $output;
  }
  else {
    return FALSE;
  }
}