$edits = $deletes = array();
} else {
try {
- $adds = $this->_connector->calendar_listBy('add', $from_ts, $to_ts);
- $edits = $this->_connector->calendar_listBy('modify', $from_ts, $to_ts);
- $deletes = $this->_connector->calendar_listBy('delete', $from_ts, $to_ts);
+ $changes = $this->_connector->calendar_getChanges($from_ts, $to_ts);
+ // @TODO: these assignments are just until all collections are refactored.
+ $adds = $changes['add'];
+ $edits = $changes['modify'];
+ $deletes = $changes['delete'];
} catch (Horde_Exception $e) {
$this->_logger->err($e->getMessage());
return array();
public function calendar_listBy($action, $from_ts, $to_ts)
{
try {
- return $this->_registry->calendar->listBy($action, $from_ts, null, $to_ts);
+ $uids = $this->_registry->calendar->listBy($action, $from_ts, null, $to_ts);
} catch (Exception $e) {
return array();
}
}
/**
+ * Obtain all calendar server chages that occured in the specified time
+ * interval.
+ *
+ * @param integer $from_ts Starting timestamp
+ * @param integer $to_ts Ending timestamp
+ *
+ * @return array Hash of add, modify, and delete arrays
+ */
+ public function calendar_getChanges($from_ts, $to_ts)
+ {
+ try {
+ return $this->_registry->calendar->getChanges($from_ts, $to_ts);
+ } catch (Exception $e) {
+ return array('add' => array(),
+ 'modify' => array(),
+ 'delete' => array());
+ }
+ }
+
+ /**
* Export the specified event as an ActiveSync message
*
* @param string $uid The calendar id