ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
Sabre\CalDAV\Subscriptions\Subscription Class Reference

Subscription Node. More...

+ Inheritance diagram for Sabre\CalDAV\Subscriptions\Subscription:
+ Collaboration diagram for Sabre\CalDAV\Subscriptions\Subscription:

Public Member Functions

 __construct (SubscriptionSupport $caldavBackend, array $subscriptionInfo)
 Constructor. More...
 
 getName ()
 Returns the name of the node. More...
 
 getLastModified ()
 Returns the last modification time. More...
 
 delete ()
 Deletes the current node. More...
 
 getChildren ()
 Returns an array with all the child nodes. More...
 
 propPatch (PropPatch $propPatch)
 Updates properties on this node. More...
 
 getProperties ($properties)
 Returns a list of properties for this nodes. More...
 
 getOwner ()
 Returns the owner principal. More...
 
 getACL ()
 Returns a list of ACE's for this node. 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...
 
 delete ()
 Deleted the current node. More...
 
 getName ()
 Returns the name of the node. More...
 
 setName ($name)
 Renames the node. More...
 
 getLastModified ()
 Returns the last modification time, as a unix timestamp. More...
 
 createFile ($name, $data=null)
 Creates a new file in the directory. More...
 
 createDirectory ($name)
 Creates a new subdirectory. More...
 
 getChild ($name)
 Returns a specific child node, referenced by its name. More...
 
 getChildren ()
 Returns an array with all the child nodes. More...
 
 childExists ($name)
 Checks if a child-node with the specified name exists. More...
 
 propPatch (PropPatch $propPatch)
 Updates properties on this node. More...
 
 getProperties ($properties)
 Returns a list of properties for this nodes. More...
 
- Public Member Functions inherited from Sabre\DAVACL\IACL
 getOwner ()
 Returns the owner principal. More...
 
 getGroup ()
 Returns a group principal. More...
 
 getACL ()
 Returns a list of ACE's for this node. More...
 
 setACL (array $acl)
 Updates the ACL. More...
 
 getSupportedPrivilegeSet ()
 Returns the list of supported privileges for this node. More...
 

Protected Attributes

 $caldavBackend
 
 $subscriptionInfo
 

Detailed Description

Subscription Node.

This node represents a subscription.

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

Definition at line 21 of file Subscription.php.

Constructor & Destructor Documentation

◆ __construct()

Sabre\CalDAV\Subscriptions\Subscription::__construct ( SubscriptionSupport  $caldavBackend,
array  $subscriptionInfo 
)

Constructor.

Parameters
SubscriptionSupport$caldavBackend
array$subscriptionInfo

Definition at line 45 of file Subscription.php.

45 {
46
47 $this->caldavBackend = $caldavBackend;
48 $this->subscriptionInfo = $subscriptionInfo;
49
50 $required = [
51 'id',
52 'uri',
53 'principaluri',
54 'source',
55 ];
56
57 foreach ($required as $r) {
58 if (!isset($subscriptionInfo[$r])) {
59 throw new \InvalidArgumentException('The ' . $r . ' field is required when creating a subscription node');
60 }
61 }
62
63 }
$r
Definition: example_031.php:79

References Sabre\CalDAV\Subscriptions\Subscription\$caldavBackend, $r, and Sabre\CalDAV\Subscriptions\Subscription\$subscriptionInfo.

Member Function Documentation

◆ delete()

Sabre\CalDAV\Subscriptions\Subscription::delete ( )

Deletes the current node.

Returns
void

Implements Sabre\DAV\INode.

Definition at line 96 of file Subscription.php.

96 {
97
98 $this->caldavBackend->deleteSubscription(
99 $this->subscriptionInfo['id']
100 );
101
102 }

◆ getACL()

Sabre\CalDAV\Subscriptions\Subscription::getACL ( )

Returns a list of ACE's for this node.

Each ACE has the following properties:

  • 'privilege', a string such as {DAV:}read or {DAV:}write. These are currently the only supported privileges
  • 'principal', a url to the principal who owns the node
  • 'protected' (optional), indicating that this ACE is not allowed to be updated.
Returns
array

Implements Sabre\DAVACL\IACL.

Definition at line 199 of file Subscription.php.

199 {
200
201 return [
202 [
203 'privilege' => '{DAV:}all',
204 'principal' => $this->getOwner(),
205 'protected' => true,
206 ],
207 [
208 'privilege' => '{DAV:}all',
209 'principal' => $this->getOwner() . '/calendar-proxy-write',
210 'protected' => true,
211 ],
212 [
213 'privilege' => '{DAV:}read',
214 'principal' => $this->getOwner() . '/calendar-proxy-read',
215 'protected' => true,
216 ]
217 ];
218
219 }
getOwner()
Returns the owner principal.

References Sabre\CalDAV\Subscriptions\Subscription\getOwner().

+ Here is the call graph for this function:

◆ getChildren()

Sabre\CalDAV\Subscriptions\Subscription::getChildren ( )

Returns an array with all the child nodes.

Returns
\Sabre\DAV\INode[]

Implements Sabre\DAV\ICollection.

Definition at line 109 of file Subscription.php.

109 {
110
111 return [];
112
113 }

◆ getLastModified()

Sabre\CalDAV\Subscriptions\Subscription::getLastModified ( )

Returns the last modification time.

Returns
int

Implements Sabre\DAV\INode.

Definition at line 83 of file Subscription.php.

83 {
84
85 if (isset($this->subscriptionInfo['lastmodified'])) {
86 return $this->subscriptionInfo['lastmodified'];
87 }
88
89 }

◆ getName()

Sabre\CalDAV\Subscriptions\Subscription::getName ( )

Returns the name of the node.

This is used to generate the url.

Returns
string

Implements Sabre\DAV\INode.

Definition at line 72 of file Subscription.php.

72 {
73
74 return $this->subscriptionInfo['uri'];
75
76 }

◆ getOwner()

Sabre\CalDAV\Subscriptions\Subscription::getOwner ( )

Returns the owner principal.

This must be a url to a principal, or null if there's no owner

Returns
string|null

Implements Sabre\DAVACL\IACL.

Definition at line 181 of file Subscription.php.

181 {
182
183 return $this->subscriptionInfo['principaluri'];
184
185 }

Referenced by Sabre\CalDAV\Subscriptions\Subscription\getACL().

+ Here is the caller graph for this function:

◆ getProperties()

Sabre\CalDAV\Subscriptions\Subscription::getProperties (   $properties)

Returns a list of properties for this nodes.

The properties list is a list of propertynames the client requested, encoded in clark-notation {xmlnamespace}tagname.

If the array is empty, it means 'all properties' were requested.

Note that it's fine to liberally give properties back, instead of conforming to the list of requested properties. The Server class will filter out the extra.

Parameters
array$properties
Returns
array

Implements Sabre\DAV\IProperties.

Definition at line 151 of file Subscription.php.

151 {
152
153 $r = [];
154
155 foreach ($properties as $prop) {
156
157 switch ($prop) {
158 case '{http://calendarserver.org/ns/}source' :
159 $r[$prop] = new Href($this->subscriptionInfo['source']);
160 break;
161 default :
162 if (array_key_exists($prop, $this->subscriptionInfo)) {
163 $r[$prop] = $this->subscriptionInfo[$prop];
164 }
165 break;
166 }
167
168 }
169
170 return $r;
171
172 }

References $r.

◆ propPatch()

Sabre\CalDAV\Subscriptions\Subscription::propPatch ( PropPatch  $propPatch)

Updates properties on this node.

This method received a PropPatch object, which contains all the information about the update.

To update specific properties, call the 'handle' method on this object. Read the PropPatch documentation for more information.

Parameters
PropPatch$propPatch
Returns
void

Implements Sabre\DAV\IProperties.

Definition at line 127 of file Subscription.php.

127 {
128
129 return $this->caldavBackend->updateSubscription(
130 $this->subscriptionInfo['id'],
131 $propPatch
132 );
133
134 }

Field Documentation

◆ $caldavBackend

Sabre\CalDAV\Subscriptions\Subscription::$caldavBackend
protected

◆ $subscriptionInfo

Sabre\CalDAV\Subscriptions\Subscription::$subscriptionInfo
protected

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