public function LingotekApi::getWorkflows in Lingotek Translation 8
Same name and namespace in other branches
- 8.2 src/Remote/LingotekApi.php \Drupal\lingotek\Remote\LingotekApi::getWorkflows()
- 4.0.x src/Remote/LingotekApi.php \Drupal\lingotek\Remote\LingotekApi::getWorkflows()
- 3.0.x src/Remote/LingotekApi.php \Drupal\lingotek\Remote\LingotekApi::getWorkflows()
- 3.1.x src/Remote/LingotekApi.php \Drupal\lingotek\Remote\LingotekApi::getWorkflows()
- 3.2.x src/Remote/LingotekApi.php \Drupal\lingotek\Remote\LingotekApi::getWorkflows()
- 3.3.x src/Remote/LingotekApi.php \Drupal\lingotek\Remote\LingotekApi::getWorkflows()
- 3.4.x src/Remote/LingotekApi.php \Drupal\lingotek\Remote\LingotekApi::getWorkflows()
- 3.5.x src/Remote/LingotekApi.php \Drupal\lingotek\Remote\LingotekApi::getWorkflows()
- 3.6.x src/Remote/LingotekApi.php \Drupal\lingotek\Remote\LingotekApi::getWorkflows()
- 3.7.x src/Remote/LingotekApi.php \Drupal\lingotek\Remote\LingotekApi::getWorkflows()
- 3.8.x src/Remote/LingotekApi.php \Drupal\lingotek\Remote\LingotekApi::getWorkflows()
Overrides LingotekApiInterface::getWorkflows
File
- src/
Remote/ LingotekApi.php, line 348 - Contains \Drupal\lingotek\Remote\LingotekApi.
Class
Namespace
Drupal\lingotek\RemoteCode
public function getWorkflows($community_id) {
try {
$this->logger
->debug('Lingotek::getWorkflows called with id ' . $community_id);
$response = $this->lingotekClient
->get('/api/workflow', array(
'community_id' => $community_id,
'limit' => 1000,
));
} catch (\Exception $e) {
$this->logger
->error('Error getting workflows for community %community: %message.', [
'%community' => $community_id,
'%message' => $e
->getMessage(),
]);
throw new LingotekApiException('Failed to get workflows: ' . $e
->getMessage());
}
$this->logger
->debug('getWorkflows response received, code %code and body %body', [
'%code' => $response
->getStatusCode(),
'%body' => (string) $response
->getBody(TRUE),
]);
return $this
->formatResponse($response);
}