Skip to content

Sync (list updated and deleted entries since ...)

Zhmayev Yaroslav edited this page Nov 30, 2017 · 1 revision

There is another useful function provided by vTiger, it allows one to get the information about the items modified and/or deleted since a given date.

// Fetch entities updated and/or deleted since
// the midnight of the first day of this month
$lastModTime = strtotime('first day of this month midnight');
$leadsSyncInfo = $client->entities->sync($lastModTime, 'Leads');
if (!isset($leadsSyncInfo['updated'])) {
    // ... do something with updated entries
}
if (!isset($leadsSyncInfo['deleted'])) {
    // ... and something else with deleted entries
}