You are here

protected function AcquiaSearchSolrApi::processResponse in Acquia Connector 7.3

Adjusts response structure.

Parameters

string $data: Data in JSON format.

Return value

array Search indexes list keyed by ID.

1 call to AcquiaSearchSolrApi::processResponse()
AcquiaSearchSolrApi::getIndexes in acquia_search/includes/AcquiaSearchSolrApi.php
Returns list of search indexes.

File

acquia_search/includes/AcquiaSearchSolrApi.php, line 233

Class

AcquiaSearchSolrApi
Class AcquiaSearchApi.

Code

protected function processResponse($data) {
  $result = [];
  $indexes = json_decode($data, TRUE);
  if (is_array($indexes)) {
    foreach ($indexes as $index) {
      $result[$index['key']] = [
        'host' => $index['host'],
        'index_id' => $index['key'],
        'data' => $index,
      ];
    }
  }
  return $result;
}