function salesforce_api_id_compare in Salesforce Suite 7.2
Same name and namespace in other branches
- 6.2 salesforce_api/salesforce_api.module \salesforce_api_id_compare()
Compares mixed 15- and 18-character Salesforce IDs. Up-converts 15-character strings for comparison when applicable. Based on Christian G. Warden's code at http://xn.pinkhamster.net/blog/tech/salesforce/convert-15-character-sale...
Return value
TRUE if IDs match, or FALSE
See also
File
- salesforce_api/
salesforce_api.module, line 2028 - Defines an API that enables modules to interact with the Salesforce server.
Code
function salesforce_api_id_compare($a, $b) {
if (strlen($a) != strlen($b)) {
if (strlen($a) == 15) {
$a = salesforce_api_id_convert($a);
}
if (strlen($b) == 15) {
$b = salesforce_api_id_convert($b);
}
}
return $a == $b;
}