protected function _queryFollowNext($query_type, $query, $url = null) { //next url has not been supplied if (is_null($url)) { $result = $this->oauth2Client->call_api('get', $query_type . '/?q=' . urlencode($query)); } else { $result = $this->oauth2Client->rawGetRequest($url); } if ($result && isset($result['records']) && $result['records']) { if (isset($result['nextRecordsUrl']) && $result['nextRecordsUrl']) { $new_result = $this->_queryFollowNext($query_type, $query, $result['nextRecordsUrl']); if ($new_result && isset($new_result['records'])) { $result['records'] = array_merge($result['records'], $new_result['records']); } } } return $result; }
public function externalUpsert($external_field_name, $external_id, $type, $data) { return new SobjectInsertResponse($this->oauth2Client->call_api('patch', 'sobjects/' . $type . '/' . $external_field_name . '/' . $external_id, ['http_errors' => false, 'body' => json_encode($data), 'headers' => ['Content-type' => 'application/json']])); }