public function RestClient::getObjectTypeName in Salesforce Suite 8.4
Same name and namespace in other branches
- 8.3 src/Rest/RestClient.php \Drupal\salesforce\Rest\RestClient::getObjectTypeName()
- 5.0.x src/Rest/RestClient.php \Drupal\salesforce\Rest\RestClient::getObjectTypeName()
Utility function to determine object type for given SFID.
Parameters
\Drupal\salesforce\SFID $id: The SFID.
Return value
string|false The object type name, or FALSE if not found.
Overrides RestClientInterface::getObjectTypeName
File
- src/
Rest/ RestClient.php, line 634
Class
- RestClient
- Objects, properties, and methods to communicate with the Salesforce REST API.
Namespace
Drupal\salesforce\RestCode
public function getObjectTypeName(SFID $id) {
$prefix = substr((string) $id, 0, 3);
$describe = $this
->objects();
foreach ($describe as $object) {
if ($prefix == $object['keyPrefix']) {
return $object['name'];
}
}
return FALSE;
}