public function LingotekDocument::translationTargets in Lingotek Translation 7.6
Same name and namespace in other branches
- 7.7 lib/Drupal/lingotek/LingotekDocument.php \LingotekDocument::translationTargets()
- 7.2 lib/Drupal/lingotek/LingotekDocument.php \LingotekDocument::translationTargets()
- 7.3 lib/Drupal/lingotek/LingotekDocument.php \LingotekDocument::translationTargets()
- 7.4 lib/Drupal/lingotek/LingotekDocument.php \LingotekDocument::translationTargets()
- 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;
}