Skip to content

Commit

Permalink
Allow specifying a calander when calling getChanges() or getChangesBy…
Browse files Browse the repository at this point in the history
…Modseq()
  • Loading branch information
mrubinsk committed Oct 31, 2013
1 parent d93e04a commit 996ce59
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions kronolith/lib/Api.php
Original file line number Diff line number Diff line change
Expand Up @@ -589,15 +589,25 @@ public function listBy($action, $timestamp, $calendar = null, $end = null, $isMo
* @param boolean $isModSeq If true, $timestamp and $end are
* modification sequences and not
* timestamps. @since 4.1.1
* @param string|array $calendars The sources to check. @since 4.2.0
*
* @return array An hash with 'add', 'modify' and 'delete' arrays.
* @throws Horde_Exception_PermissionDenied
* @throws Kronolith_Exception
*/
public function getChanges($start, $end, $ignoreExceptions = true, $isModSeq = false)
public function getChanges(
$start, $end, $ignoreExceptions = true, $isModSeq = false, $calendars = null)
{
// Only get the calendar once
$cs = Kronolith::getSyncCalendars();
if (is_null($calendars)) {
$cs = Kronolith::getSyncCalendars();
} else {
if (!is_array($calendars)) {
$calendars = array($calendars);
}
$cs = $calendars;
}

$changes = array(
'add' => array(),
'modify' => array(),
Expand Down Expand Up @@ -649,15 +659,16 @@ public function getChanges($start, $end, $ignoreExceptions = true, $isModSeq = f
* Return all changes occuring between the specified modification
* sequences.
*
* @param integer $start The starting modseq.
* @param integer $end The ending modseq.
* @param integer $start The starting modseq.
* @param integer $end The ending modseq.
* @param string|array $calendars The sources to check. @since 4.2.0
*
* @return array The changes @see getChanges()
* @since 4.1.1
*/
public function getChangesByModSeq($start, $end)
public function getChangesByModSeq($start, $end, $calendars = null)
{
return $this->getChanges($start, $end, true, true);
return $this->getChanges($start, $end, true, true, $calendars);
}

/**
Expand Down

0 comments on commit 996ce59

Please sign in to comment.