Skip to content

Commit

Permalink
Allow passing a $sources parameter to various Turba_Api:: methods.
Browse files Browse the repository at this point in the history
::listUids(), ::getChanges(), and ::getChangesByModSeq()
  • Loading branch information
mrubinsk committed Oct 31, 2013
1 parent 748748d commit 830ad03
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions turba/lib/Api.php
Expand Up @@ -546,35 +546,37 @@ public function listBy($action, $timestamp, $sources = null, $end = null, $isMod
* Essentially a wrapper around listBy(), but returns an array containing
* all adds, edits, and deletions.
*
* @param integer $start The starting timestamp
* @param integer $end The ending timestamp.
* @param boolean $isModSeq If true, $start and $end are modification
* sequences and not timestamps. @since 4.1.1
* @param integer $start The starting timestamp
* @param integer $end The ending timestamp.
* @param boolean $isModSeq If true, $start and $end are modification
* sequences and not timestamps. @since 4.1.1
* @param string|array $sources The sources to check. @since 4.2.0
*
* @return array A hash with 'add', 'modify' and 'delete' arrays.
*/
public function getChanges($start, $end, $isModSeq = false)
public function getChanges($start, $end, $isModSeq = false, $sources = null)
{
return array(
'add' => $this->listBy('add', $start, null, $end, $isModSeq),
'modify' => $this->listBy('modify', $start, null, $end, $isModSeq),
'delete' => $this->listBy('delete', $start, null, $end, $isModSeq)
'add' => $this->listBy('add', $start, $sources, $end, $isModSeq),
'modify' => $this->listBy('modify', $start, $sources, $end, $isModSeq),
'delete' => $this->listBy('delete', $start, $sources, $end, $isModSeq)
);
}

/**
* 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 $sources 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, $sources = null)
{
return $this->getChanges($start, $end, true);
return $this->getChanges($start, $end, true, $sources);
}

/**
Expand Down

0 comments on commit 830ad03

Please sign in to comment.