You are here

public function LingotekDocument::translationTargets in Lingotek Translation 7.6

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

Gets the translation targets associated with this document.

Return value

array An array of Translation Target, as returned by a getDocument Lingotek API call

File

lib/Drupal/lingotek/LingotekDocument.php, line 48
Defines LingotekDocument.

Class

LingotekDocument
A class representing a Lingotek Document

Code

public function translationTargets() {
  $targets = array();
  if ($document = LingotekApi::instance()
    ->getDocument($this->document_id)) {
    if (!empty($document->translationTargets)) {
      foreach ($document->translationTargets as $target) {
        $targets[Lingotek::convertLingotek2Drupal($target->language)] = $target;
      }
    }
  }
  return $targets;
}