protected function LingotekApi::formatResponse in Lingotek Translation 8
Same name and namespace in other branches
- 8.2 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()
4 calls to LingotekApi::formatResponse()
- LingotekApi::getCommunities in src/
Remote/ LingotekApi.php - 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 361 - Contains \Drupal\lingotek\Remote\LingotekApi.
Class
Namespace
Drupal\lingotek\RemoteCode
protected function formatResponse($response) {
$formatted_response = array();
$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;
}