public function Lingotek::downloadDocument in Lingotek Translation 8
Same name and namespace in other branches
- 8.2 src/Lingotek.php \Drupal\lingotek\Lingotek::downloadDocument()
- 4.0.x src/Lingotek.php \Drupal\lingotek\Lingotek::downloadDocument()
- 3.0.x src/Lingotek.php \Drupal\lingotek\Lingotek::downloadDocument()
- 3.1.x src/Lingotek.php \Drupal\lingotek\Lingotek::downloadDocument()
- 3.2.x src/Lingotek.php \Drupal\lingotek\Lingotek::downloadDocument()
- 3.3.x src/Lingotek.php \Drupal\lingotek\Lingotek::downloadDocument()
- 3.4.x src/Lingotek.php \Drupal\lingotek\Lingotek::downloadDocument()
- 3.5.x src/Lingotek.php \Drupal\lingotek\Lingotek::downloadDocument()
- 3.6.x src/Lingotek.php \Drupal\lingotek\Lingotek::downloadDocument()
- 3.7.x src/Lingotek.php \Drupal\lingotek\Lingotek::downloadDocument()
- 3.8.x src/Lingotek.php \Drupal\lingotek\Lingotek::downloadDocument()
Overrides LingotekInterface::downloadDocument
File
- src/
Lingotek.php, line 378 - Contains \Drupal\lingotek\Lingotek.
Class
Namespace
Drupal\lingotekCode
public function downloadDocument($doc_id, $locale) {
// For now, a passthrough to the API object so the controllers do not
// need to include that class.
$response = $this->api
->getTranslation($doc_id, $locale);
if ($response
->getStatusCode() == Response::HTTP_OK) {
return json_decode($response
->getBody(), TRUE);
}
return FALSE;
}