39 function addChange(array $added, array $modified, array $deleted) {
44 'modified' => $modified,
45 'deleted' => $deleted,
105 if (is_null($syncToken)) {
107 'added' => array_map(
109 return $item->getName();
118 if (!is_int($syncToken) && !ctype_digit($syncToken)) {
123 if (is_null($this->token))
return null;
129 foreach ($this->changeLog as
$token => $change) {
131 if (
$token > $syncToken) {
133 $added = array_merge($added, $change[
'added']);
134 $modified = array_merge($modified, $change[
'modified']);
135 $deleted = array_merge($deleted, $change[
'deleted']);
140 $left = $limit - (count($modified) + count($deleted));
141 if ($left > 0)
continue;
142 if ($left === 0)
break;
144 $modified = array_slice($modified, 0, $left);
146 $left = $limit - (count($modified) + count($deleted));
147 if ($left === 0)
break;
149 $deleted = array_slice($deleted, 0, $left);
162 'modified' => $modified,
163 'deleted' => $deleted,
getChildren()
Returns a list of children for this collection.
This mocks a ISyncCollection, for unittesting.
getSyncToken()
This method returns the current sync-token for this collection.
getChanges($syncToken, $syncLevel, $limit=null)
The getChanges method returns all the changes that have happened, since the specified syncToken and t...
If a class extends ISyncCollection, it supports WebDAV-sync.
addChange(array $added, array $modified, array $deleted)