protected function LingotekApi::formatResponse in Lingotek Translation 8.2
Same name and namespace in other branches
- 8 src/Remote/LingotekApi.php \Drupal\lingotek\Remote\LingotekApi::formatResponse()
- 4.0.x src/Remote/LingotekApi.php \Drupal\lingotek\Remote\LingotekApi::formatResponse()
- 3.0.x src/Remote/LingotekApi.php \Drupal\lingotek\Remote\LingotekApi::formatResponse()
- 3.1.x src/Remote/LingotekApi.php \Drupal\lingotek\Remote\LingotekApi::formatResponse()
- 3.2.x src/Remote/LingotekApi.php \Drupal\lingotek\Remote\LingotekApi::formatResponse()
- 3.3.x src/Remote/LingotekApi.php \Drupal\lingotek\Remote\LingotekApi::formatResponse()
- 3.4.x src/Remote/LingotekApi.php \Drupal\lingotek\Remote\LingotekApi::formatResponse()
- 3.5.x src/Remote/LingotekApi.php \Drupal\lingotek\Remote\LingotekApi::formatResponse()
- 3.6.x src/Remote/LingotekApi.php \Drupal\lingotek\Remote\LingotekApi::formatResponse()
- 3.7.x src/Remote/LingotekApi.php \Drupal\lingotek\Remote\LingotekApi::formatResponse()
- 3.8.x src/Remote/LingotekApi.php \Drupal\lingotek\Remote\LingotekApi::formatResponse()
5 calls to LingotekApi::formatResponse()
- LingotekApi::getCommunities in src/
Remote/ LingotekApi.php - LingotekApi::getFilters in src/
Remote/ LingotekApi.php - Get the available filters on Lingotek.
- LingotekApi::getProjects in src/
Remote/ LingotekApi.php - LingotekApi::getVaults in src/
Remote/ LingotekApi.php - LingotekApi::getWorkflows in src/
Remote/ LingotekApi.php
File
- src/
Remote/ LingotekApi.php, line 431
Class
- LingotekApi
- A simple connector to the Lingotek Translation API.
Namespace
Drupal\lingotek\RemoteCode
protected function formatResponse($response) {
$formatted_response = [];
$json_response = json_decode($response
->getBody(), TRUE);
if (!empty($json_response['entities'])) {
foreach ($json_response['entities'] as $entity) {
if (!empty($entity['properties']['id']) && !empty($entity['properties']['title'])) {
$formatted_response[$entity['properties']['id']] = $entity['properties']['title'];
}
}
}
return $formatted_response;
}