code/thirdparty/gapi.php
protected function accountObjectMapper($json_string) {
    $json = json_decode($json_string, true);
    $results = array();

    foreach ($json['items'] as $item) {
      foreach ($item['webProperties'] as $property) {
        if (isset($property['profiles'][0]['id'])) {
          $property['ProfileId'] = $property['profiles'][0]['id'];
        }
        $results[] = new gapiAccountEntry($property);
      }
    }

    $this->account_entries = $results;

    return $results;
  }
protected function accountObjectMapper($json_string) {
    $json = json_decode($json_string, true);
    $results = array();

    foreach ($json['items'] as $item) {
      foreach ($item['webProperties'] as $property) {
        if (isset($property['profiles'][0]['id'])) {
          $property['ProfileId'] = $property['profiles'][0]['id'];
        }
        $results[] = new gapiAccountEntry($property);
      }
    }

    $this->account_entries = $results;

    return $results;
  }
Report Account Mapper to convert the JSON to array of useful PHP objects

@param String $json_string
@return Array of gapiAccountEntry objects