diff options
author | redmatrix <git@macgirvin.com> | 2016-05-10 17:26:44 -0700 |
---|---|---|
committer | redmatrix <git@macgirvin.com> | 2016-05-10 17:26:44 -0700 |
commit | 0b02a6d123b2014705998c94ddf3d460948d3eac (patch) | |
tree | 78ff2cab9944a4f5ab3f80ec93cbe1120de90bb2 /vendor/sabre/dav/lib/DAV/MkCol.php | |
parent | 40b5b6e9d2da7ab65c8b4d38cdceac83a4d78deb (diff) | |
download | volse-hubzilla-0b02a6d123b2014705998c94ddf3d460948d3eac.tar.gz volse-hubzilla-0b02a6d123b2014705998c94ddf3d460948d3eac.tar.bz2 volse-hubzilla-0b02a6d123b2014705998c94ddf3d460948d3eac.zip |
initial sabre upgrade (needs lots of work - to wit: authentication, redo the browser interface, and rework event export/import)
Diffstat (limited to 'vendor/sabre/dav/lib/DAV/MkCol.php')
-rw-r--r-- | vendor/sabre/dav/lib/DAV/MkCol.php | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/vendor/sabre/dav/lib/DAV/MkCol.php b/vendor/sabre/dav/lib/DAV/MkCol.php new file mode 100644 index 000000000..c79055418 --- /dev/null +++ b/vendor/sabre/dav/lib/DAV/MkCol.php @@ -0,0 +1,71 @@ +<?php + +namespace Sabre\DAV; + +/** + * 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. + * + * @copyright Copyright (C) fruux GmbH (https://fruux.com/) + * @author Evert Pot (http://evertpot.com/) + * @license http://sabre.io/license/ Modified BSD License + */ +class MkCol extends PropPatch { + + /** + * A list of resource-types in clark-notation. + * + * @var array + */ + protected $resourceType; + + /** + * Creates the MKCOL object. + * + * @param string[] $resourceType List of resourcetype values. + * @param array $mutations List of new properties values. + */ + function __construct(array $resourceType, array $mutations) { + + $this->resourceType = $resourceType; + parent::__construct($mutations); + + } + + /** + * Returns the resourcetype of the new collection. + * + * @return string[] + */ + function getResourceType() { + + return $this->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. + * + * @param string|string[] $resourceType + */ + function hasResourceType($resourceType) { + + return count(array_diff((array)$resourceType, $this->resourceType)) === 0; + + } + +} |