ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
SharedNode.php
Go to the documentation of this file.
1<?php
2
3namespace Sabre\DAV\Mock;
4
7
8class SharedNode extends \Sabre\DAV\Node implements ISharedNode {
9
10 protected $name;
11 protected $access;
12 protected $invites = [];
13
15
16 $this->name = $name;
17 $this->access = $access;
18
19 }
20
21 function getName() {
22
23 return $this->name;
24
25 }
26
35 function getShareAccess() {
36
37 return $this->access;
38
39 }
40
53
54 return 'urn:example:bar';
55
56 }
57
66 function updateInvites(array $sharees) {
67
68 foreach ($sharees as $sharee) {
69
70 if ($sharee->access === \Sabre\DAV\Sharing\Plugin::ACCESS_NOACCESS) {
71 // Removal
72 foreach ($this->invites as $k => $invitee) {
73
74 if ($invitee->href = $sharee->href) {
75 unset($this->invites[$k]);
76 }
77
78 }
79
80 } else {
81 foreach ($this->invites as $k => $invitee) {
82
83 if ($invitee->href = $sharee->href) {
84 if (!$sharee->inviteStatus) {
85 $sharee->inviteStatus = $invitee->inviteStatus;
86 }
87 // Overwriting an existing invitee
88 $this->invites[$k] = $sharee;
89 continue 2;
90 }
91
92 }
93 if (!$sharee->inviteStatus) {
95 }
96 // Adding a new invitee
97 $this->invites[] = $sharee;
98 }
99
100 }
101
102 }
103
120 function getInvites() {
121
122 return $this->invites;
123
124 }
125}
An exception for terminatinating execution or to throw for unit testing.
getShareAccess()
Returns the 'access level' for the instance of this shared resource.
Definition: SharedNode.php:35
getShareResourceUri()
This function must return a URI that uniquely identifies the shared resource.
Definition: SharedNode.php:52
__construct($name, $access)
Definition: SharedNode.php:14
updateInvites(array $sharees)
Updates the list of sharees.
Definition: SharedNode.php:66
getInvites()
Returns the list of people whom this resource is shared with.
Definition: SharedNode.php:120
getName()
Returns the name of the node.
Definition: SharedNode.php:21
Node class.
Definition: Node.php:14
This class represents the {DAV:}sharee element.
Definition: Sharee.php:21
This interface represents a resource that has sharing capabilities, either because it's possible for ...
Definition: ISharedNode.php:16