We are attempting to keep two systems in live sync with each other, one is CiviCRM.
There are hooks in civicrm for:
Pre database saving of data
hook_civicrm_pre($op, $objectName, $objectId, &$objectRef) {}
and
Post database saving of data
hook_civicrm_post($op, $objectName, $objectId, &$objectRef) {}
but both functions are passed all of the data of the relevant form/group/profile that has been submitted rather than just data that has changed. i.e. civicrm considers all of the fields to have been updated even if it isn't the case.
Is the only option to go through each submitted field and compare the posted value to it's current value during callhooks_civicrm_pre? and then only update the 'other' system on callhooks_civicrm_post so that data that isn't actually saved isn't sent to the 'other' system.
Perhaps there is a better way, like a hook from the changelog?