public function Salesforce::getUpdated in Salesforce Suite 7.3
Same name and namespace in other branches
- 5.2 includes/salesforce.php \salesforce::getUpdated()
- 5 includes/salesforce.php \salesforce::getUpdated()
Return a list of SFIDs for the given object, which have been created or updated in the given timeframe.
Parameters
string $name: Object type name, E.g., Contact, Account.
int $start: unix timestamp for older timeframe for updates. Defaults to "-29 days" if empty.
int $end: unix timestamp for end of timeframe for updates. Defaults to now if empty
Return value
array return array has 2 indexes: "ids": a list of SFIDs of those records which have been created or updated in the given timeframe. "latestDateCovered": ISO 8601 format timestamp (UTC) of the last date covered in the request.
See also
https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest...
File
- includes/
salesforce.inc, line 783 - Objects, properties, and methods to communicate with the Salesforce REST API
Class
- Salesforce
- Ability to authorize and communicate with the Salesforce REST API.
Code
public function getUpdated($name, $start = null, $end = null) {
if (empty($start)) {
$start = strtotime('-29 days');
}
$start = urlencode(gmdate(DATE_ATOM, $start));
if (empty($end)) {
$end = time();
}
$end = urlencode(gmdate(DATE_ATOM, $end));
return $this
->apiCall("sobjects/{$name}/updated/?start={$start}&end={$end}");
}