ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
|
This class represents a set of properties that are going to be updated. More...
Public Member Functions | |
__construct (array $mutations) | |
Constructor. More... | |
handle ($properties, callable $callback) | |
Call this function if you wish to handle updating certain properties. More... | |
handleRemaining (callable $callback) | |
Call this function if you wish to handle all properties that haven't been handled by anything else yet. More... | |
setResultCode ($properties, $resultCode) | |
Sets the result code for one or more properties. More... | |
setRemainingResultCode ($resultCode) | |
Sets the result code for all properties that did not have a result yet. More... | |
getRemainingMutations () | |
Returns the list of properties that don't have a result code yet. More... | |
getRemainingValues () | |
Returns the list of properties that don't have a result code yet. More... | |
commit () | |
Performs the actual update, and calls all callbacks. More... | |
getResult () | |
Returns the result of the operation. More... | |
getMutations () | |
Returns the full list of mutations. More... | |
Protected Attributes | |
$mutations | |
$result = [] | |
$propertyUpdateCallbacks = [] | |
$failed = false | |
Private Member Functions | |
doCallBackSingleProp ($propertyName, callable $callback) | |
Executes a property callback with the single-property syntax. More... | |
doCallBackMultiProp (array $propertyList, callable $callback) | |
Executes a property callback with the multi-property syntax. More... | |
This class represents a set of properties that are going to be updated.
Usually this is simply a PROPPATCH request, but it can also be used for internal updates.
Property updates must always be atomic. This means that a property update must either completely succeed, or completely fail.
Definition at line 20 of file PropPatch.php.
Sabre\DAV\PropPatch::__construct | ( | array | $mutations | ) |
Constructor.
array | $mutations | A list of updates |
Definition at line 59 of file PropPatch.php.
References Sabre\DAV\PropPatch\$mutations.
Sabre\DAV\PropPatch::commit | ( | ) |
Performs the actual update, and calls all callbacks.
This method returns true or false depending on if the operation was successful.
If anywhere in this operation updating a property failed, we must update all other properties accordingly.
Definition at line 225 of file PropPatch.php.
References Sabre\DAV\PropPatch\$failed.
Referenced by Sabre\DAV\Server\createCollection().
|
private |
Executes a property callback with the multi-property syntax.
array | $propertyList | |
callable | $callback |
Definition at line 310 of file PropPatch.php.
References Sabre\DAV\PropPatch\$result.
|
private |
Executes a property callback with the single-property syntax.
string | $propertyName | |
callable | $callback |
Definition at line 276 of file PropPatch.php.
References Sabre\DAV\PropPatch\$result.
Sabre\DAV\PropPatch::getMutations | ( | ) |
Returns the full list of mutations.
Definition at line 367 of file PropPatch.php.
References Sabre\DAV\PropPatch\$mutations.
Referenced by Sabre\DAV\TreeFileTester\propPatch(), and Sabre\DAV\CorePlugin\propPatchProtectedPropertyCheck().
Sabre\DAV\PropPatch::getRemainingMutations | ( | ) |
Returns the list of properties that don't have a result code yet.
This method returns a list of property names, but not its values.
Definition at line 184 of file PropPatch.php.
References $remaining.
Referenced by Sabre\DAV\Server\createCollection(), Sabre\DAV\PropPatch\handleRemaining(), and Sabre\DAV\PropPatch\setRemainingResultCode().
Sabre\DAV\PropPatch::getRemainingValues | ( | ) |
Returns the list of properties that don't have a result code yet.
This method returns list of properties and their values.
Definition at line 204 of file PropPatch.php.
References $remaining.
Referenced by Sabre\CalDAV\CalendarHome\createExtendedCollection().
Sabre\DAV\PropPatch::getResult | ( | ) |
Returns the result of the operation.
Definition at line 356 of file PropPatch.php.
References Sabre\DAV\PropPatch\$result.
Referenced by Sabre\DAV\Server\createCollection().
Sabre\DAV\PropPatch::handle | ( | $properties, | |
callable | $callback | ||
) |
Call this function if you wish to handle updating certain properties.
For instance, your class may be responsible for handling updates for the {DAV:}displayname property.
In that case, call this method with the first argument "{DAV:}displayname" and a second argument that's a method that does the actual updating.
It's possible to specify more than one property as an array.
The callback must return a boolean or an it. If the result is true, the operation was considered successful. If it's false, it's consided failed.
If the result is an integer, we'll use that integer as the http status code associated with the operation.
string|string[] | $properties | |
callable | $callback |
Definition at line 87 of file PropPatch.php.
Referenced by Sabre\CalDAV\Schedule\Plugin\propPatch(), Sabre\DAV\HTTPPreferParsingTest\testproppatchMinimal(), and Sabre\DAV\ServerUpdatePropertiesTest\testUpdatePropertiesEventSuccess().
Sabre\DAV\PropPatch::handleRemaining | ( | callable | $callback | ) |
Call this function if you wish to handle all properties that haven't been handled by anything else yet.
Note that you effectively claim with this that you promise to process all properties that are coming in.
callable | $callback |
Definition at line 123 of file PropPatch.php.
References Sabre\DAV\PropPatch\getRemainingMutations().
Referenced by Sabre\DAV\Mock\PropertiesCollection\propPatch(), Sabre\DAV\PropertyStorage\Backend\Mock\propPatch(), Sabre\DAV\PropertyStorage\Backend\PDO\propPatch(), Sabre\DAV\ServerUpdatePropertiesTest\testUpdatePropertiesEventFail(), and Sabre\DAV\ServerUpdatePropertiesTest\testUpdatePropertiesProtected().
Sabre\DAV\PropPatch::setRemainingResultCode | ( | $resultCode | ) |
Sets the result code for all properties that did not have a result yet.
int | $resultCode |
Definition at line 168 of file PropPatch.php.
References Sabre\DAV\PropPatch\getRemainingMutations(), and Sabre\DAV\PropPatch\setResultCode().
Referenced by Sabre\CalDAV\CalendarHome\createExtendedCollection(), and Sabre\DAV\TreeFileTester\propPatch().
Sabre\DAV\PropPatch::setResultCode | ( | $properties, | |
$resultCode | |||
) |
Sets the result code for one or more properties.
string|string[] | $properties | |
int | $resultCode |
Definition at line 150 of file PropPatch.php.
Referenced by Sabre\DAV\CorePlugin\propPatchProtectedPropertyCheck(), Sabre\DAV\PropPatch\setRemainingResultCode(), and Sabre\DAV\ServerUpdatePropertiesTest\testUpdatePropertiesEventFail().
|
protected |
Definition at line 52 of file PropPatch.php.
Referenced by Sabre\DAV\PropPatch\commit().
|
protected |
Definition at line 30 of file PropPatch.php.
Referenced by Sabre\DAV\PropPatch\__construct(), and Sabre\DAV\PropPatch\getMutations().
|
protected |
Definition at line 45 of file PropPatch.php.
|
protected |
Definition at line 38 of file PropPatch.php.
Referenced by Sabre\DAV\PropPatch\doCallBackMultiProp(), Sabre\DAV\PropPatch\doCallBackSingleProp(), and Sabre\DAV\PropPatch\getResult().