/**
* Returns a timestamp stored in the map for a given Server ID.
*
* The timestamp is the timestamp of the last change to this server ID
* that was done inside a sync session (as a result of a change received
* by the server). It's important to distinguish changes in the backend a)
* made by the user during normal operation and b) changes made by SyncML
* to reflect client updates. When the server is sending its changes it
* is only allowed to send type a). However the history feature in the
* backend my not know if a change is of type a) or type b). So the
* timestamp is used to differentiate between the two.
*
* @param string $databaseURI URI of database to sync. Like calendar,
* tasks, contacts or notes. May include
* optional parameters:
* tasks?options=ignorecompleted.
* @param string $suid The server ID.
*
* @return mixed The previously stored timestamp or false if no entry is
* found.
*/
protected function _getChangeTS($databaseURI, $suid)
{
$database = $this->normalize($databaseURI);
$query = 'SELECT syncml_timestamp FROM horde_syncml_map ' . 'WHERE syncml_syncpartner = ? AND syncml_db = ? AND ' . 'syncml_uid = ? AND syncml_suid = ?';
$values = array($this->_syncDeviceID, $database, $this->_user, $suid);
return $this->_db->selectValue($query, $values);
}