ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
|
This mocks a ISyncCollection, for unittesting. More...
Public Member Functions | |
getSyncToken () | |
This method returns the current sync-token for this collection. More... | |
addChange (array $added, array $modified, array $deleted) | |
getChanges ($syncToken, $syncLevel, $limit=null) | |
The getChanges method returns all the changes that have happened, since the specified syncToken and the current collection. More... | |
Public Member Functions inherited from Sabre\DAV\SimpleCollection | |
__construct ($name, array $children=[]) | |
Creates this node. More... | |
addChild (INode $child) | |
Adds a new childnode to this collection. More... | |
getName () | |
Returns the name of the collection. More... | |
getChild ($name) | |
Returns a child object, by its name. More... | |
getChildren () | |
Returns a list of children for this collection. More... | |
Public Member Functions inherited from Sabre\DAV\Collection | |
getChild ($name) | |
Returns a child object, by its name. More... | |
childExists ($name) | |
Checks is a child-node exists. More... | |
createFile ($name, $data=null) | |
Creates a new file in the directory. More... | |
createDirectory ($name) | |
Creates a new subdirectory. More... | |
Public Member Functions inherited from Sabre\DAV\Node | |
getLastModified () | |
Returns the last modification time as a unix timestamp. More... | |
delete () | |
Deletes the current node. More... | |
setName ($name) | |
Renames the node. More... | |
Data Fields | |
$changeLog = [] | |
$token = null | |
Additional Inherited Members | |
Protected Attributes inherited from Sabre\DAV\SimpleCollection | |
$children = [] | |
$name | |
This mocks a ISyncCollection, for unittesting.
This object behaves the same as SimpleCollection. Call addChange to update the 'changelog' that this class uses for the collection.
Definition at line 17 of file MockSyncCollection.php.
Sabre\DAV\Sync\MockSyncCollection::addChange | ( | array | $added, |
array | $modified, | ||
array | $deleted | ||
) |
Definition at line 39 of file MockSyncCollection.php.
References Sabre\DAV\Sync\MockSyncCollection\$token.
Sabre\DAV\Sync\MockSyncCollection::getChanges | ( | $syncToken, | |
$syncLevel, | |||
$limit = null |
|||
) |
The getChanges method returns all the changes that have happened, since the specified syncToken and the current collection.
This function should return an array, such as the following:
array( 'syncToken' => 'The current synctoken', 'modified' => array( 'new.txt', ), 'deleted' => array( 'foo.php.bak', 'old.txt' ) );
The syncToken property should reflect the current syncToken of the collection, as reported getSyncToken(). This is needed here too, to ensure the operation is atomic.
If the syncToken is specified as null, this is an initial sync, and all members should be reported.
The modified property is an array of nodenames that have changed since the last token.
The deleted property is an array with nodenames, that have been deleted from collection.
The second argument is basically the 'depth' of the report. If it's 1, you only have to report changes that happened only directly in immediate descendants. If it's 2, it should also include changes from the nodes below the child collections. (grandchildren)
The third (optional) argument allows a client to specify how many results should be returned at most. If the limit is not specified, it should be treated as infinite.
If the limit (infinite or not) is higher than you're willing to return, you should throw a Sabre() exception.
If the syncToken is expired (due to data cleanup) or unknown, you must return null.
The limit is 'suggestive'. You are free to ignore it.
string | $syncToken | |
int | $syncLevel | |
int | $limit |
Implements Sabre\DAV\Sync\ISyncCollection.
Definition at line 102 of file MockSyncCollection.php.
References Sabre\DAV\Sync\MockSyncCollection\$token, Sabre\DAV\SimpleCollection\getChildren(), and Sabre\DAV\Sync\MockSyncCollection\getSyncToken().
Sabre\DAV\Sync\MockSyncCollection::getSyncToken | ( | ) |
This method returns the current sync-token for this collection.
This can be any string.
If null is returned from this function, the plugin assumes there's no sync information available.
Implements Sabre\DAV\Sync\ISyncCollection.
Definition at line 32 of file MockSyncCollection.php.
References Sabre\DAV\Sync\MockSyncCollection\$token.
Referenced by Sabre\DAV\Sync\MockSyncCollection\getChanges().
Sabre\DAV\Sync\MockSyncCollection::$changeLog = [] |
Definition at line 19 of file MockSyncCollection.php.
Sabre\DAV\Sync\MockSyncCollection::$token = null |
Definition at line 21 of file MockSyncCollection.php.
Referenced by Sabre\DAV\Sync\MockSyncCollection\addChange(), Sabre\DAV\Sync\MockSyncCollection\getChanges(), and Sabre\DAV\Sync\MockSyncCollection\getSyncToken().