ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
Sabre\DAV\MkCol Class Reference

This class represents a MKCOL operation. More...

+ Inheritance diagram for Sabre\DAV\MkCol:
+ Collaboration diagram for Sabre\DAV\MkCol:

Public Member Functions

 __construct (array $resourceType, array $mutations)
 Creates the MKCOL object. More...
 
 getResourceType ()
 Returns the resourcetype of the new collection. More...
 
 hasResourceType ($resourceType)
 Returns true or false if the MKCOL operation has at least the specified resource type. More...
 
- Public Member Functions inherited from Sabre\DAV\PropPatch
 __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

 $resourceType
 
- Protected Attributes inherited from Sabre\DAV\PropPatch
 $mutations
 
 $result = []
 
 $propertyUpdateCallbacks = []
 
 $failed = false
 

Detailed Description

This class represents a MKCOL operation.

MKCOL creates a new collection. MKCOL comes in two flavours:

  1. MKCOL with no body, signifies the creation of a simple collection.
  2. MKCOL with a request body. This can create a collection with a specific resource type, and a set of properties that should be set on the new collection. This can be used to create caldav calendars, carddav address books, etc.

Property updates must always be atomic. This means that a property update must either completely succeed, or completely fail.

Author
Evert Pot (http://evertpot.com/) http://sabre.io/license/ Modified BSD License

Definition at line 23 of file MkCol.php.

Constructor & Destructor Documentation

◆ __construct()

Sabre\DAV\MkCol::__construct ( array  $resourceType,
array  $mutations 
)

Creates the MKCOL object.

Parameters
string[]$resourceType List of resourcetype values.
array$mutationsList of new properties values.

Definition at line 38 of file MkCol.php.

References Sabre\DAV\MkCol\$resourceType.

38  {
39 
40  $this->resourceType = $resourceType;
41  parent::__construct($mutations);
42 
43  }

Member Function Documentation

◆ getResourceType()

Sabre\DAV\MkCol::getResourceType ( )

Returns the resourcetype of the new collection.

Returns
string[]

Definition at line 50 of file MkCol.php.

References Sabre\DAV\MkCol\$resourceType.

Referenced by Sabre\DAV\Server\createCollection(), and Sabre\CalDAV\CalendarHome\createExtendedCollection().

50  {
51 
52  return $this->resourceType;
53 
54  }
+ Here is the caller graph for this function:

◆ hasResourceType()

Sabre\DAV\MkCol::hasResourceType (   $resourceType)

Returns true or false if the MKCOL operation has at least the specified resource type.

If the resourcetype is specified as an array, all resourcetypes are checked.

Parameters
string|string[]$resourceType
Returns
bool

Definition at line 66 of file MkCol.php.

References Sabre\DAV\MkCol\$resourceType.

Referenced by Sabre\DAVACL\PrincipalCollection\createExtendedCollection().

66  {
67 
68  return count(array_diff((array)$resourceType, $this->resourceType)) === 0;
69 
70  }
+ Here is the caller graph for this function:

Field Documentation

◆ $resourceType

Sabre\DAV\MkCol::$resourceType
protected

The documentation for this class was generated from the following file: