protected function RestClient::updateApiUsage in Salesforce Suite 8.4
Same name and namespace in other branches
- 8.3 src/Rest/RestClient.php \Drupal\salesforce\Rest\RestClient::updateApiUsage()
- 5.0.x src/Rest/RestClient.php \Drupal\salesforce\Rest\RestClient::updateApiUsage()
Helper to extract API Usage info from response header and write to state.
Parameters
\Drupal\salesforce\Rest\RestResponse $response: A REST API response.
1 call to RestClient::updateApiUsage()
- RestClient::apiCall in src/
Rest/ RestClient.php - Make a call to the Salesforce REST API.
File
- src/
Rest/ RestClient.php, line 397
Class
- RestClient
- Objects, properties, and methods to communicate with the Salesforce REST API.
Namespace
Drupal\salesforce\RestCode
protected function updateApiUsage(RestResponse $response) {
if ($limit_info = $response
->getHeader('Sforce-Limit-Info')) {
if (is_array($limit_info)) {
$limit_info = reset($limit_info);
}
$this->state
->set('salesforce.usage', $limit_info);
}
}