public function RestClient::objectDescribe in Salesforce Suite 8.4
Same name and namespace in other branches
- 8.3 src/Rest/RestClient.php \Drupal\salesforce\Rest\RestClient::objectDescribe()
- 5.0.x src/Rest/RestClient.php \Drupal\salesforce\Rest\RestClient::objectDescribe()
Retrieve all the metadata for an object.
Parameters
string $name: Object type name, E.g., Contact, Account, etc.
bool $reset: Whether to reset the cache and retrieve a fresh version from Salesforce.
Return value
\Drupal\salesforce\Rest\RestResponseDescribe The describe result.
Overrides RestClientInterface::objectDescribe
1 method overrides RestClient::objectDescribe()
- TestRestClient::objectDescribe in src/
Tests/ TestRestClient.php - Hard-code the object descriptions for testing.
File
- src/
Rest/ RestClient.php, line 478
Class
- RestClient
- Objects, properties, and methods to communicate with the Salesforce REST API.
Namespace
Drupal\salesforce\RestCode
public function objectDescribe($name, $reset = FALSE) {
if (empty($name)) {
throw new \Exception($this
->t('No name provided to describe'));
}
if (!$reset && ($cache = $this->cache
->get('salesforce:object:' . $name))) {
return $cache->data;
}
else {
$response = new RestResponseDescribe($this
->apiCall("sobjects/{$name}/describe", [], 'GET', TRUE));
$this->cache
->set('salesforce:object:' . $name, $response, $this
->getRequestTime() + self::CACHE_LIFETIME, [
'salesforce',
]);
return $response;
}
}