@@ -10,335 +10,335 @@ |
||
10 | 10 | use OCP\Share\IShare; |
11 | 11 | |
12 | 12 | class CloudFederationShare implements ICloudFederationShare { |
13 | - private $share = [ |
|
14 | - 'shareWith' => '', |
|
15 | - 'shareType' => '', |
|
16 | - 'name' => '', |
|
17 | - 'resourceType' => '', |
|
18 | - 'description' => '', |
|
19 | - 'providerId' => '', |
|
20 | - 'owner' => '', |
|
21 | - 'ownerDisplayName' => '', |
|
22 | - 'sharedBy' => '', |
|
23 | - 'sharedByDisplayName' => '', |
|
24 | - 'sender' => '', |
|
25 | - 'senderDisplayName' => '', |
|
26 | - 'protocol' => [] |
|
27 | - ]; |
|
13 | + private $share = [ |
|
14 | + 'shareWith' => '', |
|
15 | + 'shareType' => '', |
|
16 | + 'name' => '', |
|
17 | + 'resourceType' => '', |
|
18 | + 'description' => '', |
|
19 | + 'providerId' => '', |
|
20 | + 'owner' => '', |
|
21 | + 'ownerDisplayName' => '', |
|
22 | + 'sharedBy' => '', |
|
23 | + 'sharedByDisplayName' => '', |
|
24 | + 'sender' => '', |
|
25 | + 'senderDisplayName' => '', |
|
26 | + 'protocol' => [] |
|
27 | + ]; |
|
28 | 28 | |
29 | - /** |
|
30 | - * get a CloudFederationShare Object to prepare a share you want to send |
|
31 | - * |
|
32 | - * @param string $shareWith |
|
33 | - * @param string $name resource name (e.g. document.odt) |
|
34 | - * @param string $description share description (optional) |
|
35 | - * @param string $providerId resource UID on the provider side |
|
36 | - * @param string $owner provider specific UID of the user who owns the resource |
|
37 | - * @param string $ownerDisplayName display name of the user who shared the item |
|
38 | - * @param string $sharedBy provider specific UID of the user who shared the resource |
|
39 | - * @param string $sharedByDisplayName display name of the user who shared the resource |
|
40 | - * @param string $shareType ('group' or 'user' share) |
|
41 | - * @param string $resourceType ('file', 'calendar',...) |
|
42 | - * @param string $sharedSecret |
|
43 | - */ |
|
44 | - public function __construct($shareWith = '', |
|
45 | - $name = '', |
|
46 | - $description = '', |
|
47 | - $providerId = '', |
|
48 | - $owner = '', |
|
49 | - $ownerDisplayName = '', |
|
50 | - $sharedBy = '', |
|
51 | - $sharedByDisplayName = '', |
|
52 | - $shareType = '', |
|
53 | - $resourceType = '', |
|
54 | - $sharedSecret = '', |
|
55 | - ) { |
|
56 | - $this->setShareWith($shareWith); |
|
57 | - $this->setResourceName($name); |
|
58 | - $this->setDescription($description); |
|
59 | - $this->setProviderId($providerId); |
|
60 | - $this->setOwner($owner); |
|
61 | - $this->setOwnerDisplayName($ownerDisplayName); |
|
62 | - $this->setSharedBy($sharedBy); |
|
63 | - $this->setSharedByDisplayName($sharedByDisplayName); |
|
64 | - $this->setProtocol([ |
|
65 | - 'name' => 'webdav', |
|
66 | - 'options' => [ |
|
67 | - 'sharedSecret' => $sharedSecret, |
|
68 | - 'permissions' => '{http://open-cloud-mesh.org/ns}share-permissions' |
|
69 | - ] |
|
70 | - ]); |
|
71 | - $this->setShareType($shareType); |
|
72 | - $this->setResourceType($resourceType); |
|
73 | - } |
|
29 | + /** |
|
30 | + * get a CloudFederationShare Object to prepare a share you want to send |
|
31 | + * |
|
32 | + * @param string $shareWith |
|
33 | + * @param string $name resource name (e.g. document.odt) |
|
34 | + * @param string $description share description (optional) |
|
35 | + * @param string $providerId resource UID on the provider side |
|
36 | + * @param string $owner provider specific UID of the user who owns the resource |
|
37 | + * @param string $ownerDisplayName display name of the user who shared the item |
|
38 | + * @param string $sharedBy provider specific UID of the user who shared the resource |
|
39 | + * @param string $sharedByDisplayName display name of the user who shared the resource |
|
40 | + * @param string $shareType ('group' or 'user' share) |
|
41 | + * @param string $resourceType ('file', 'calendar',...) |
|
42 | + * @param string $sharedSecret |
|
43 | + */ |
|
44 | + public function __construct($shareWith = '', |
|
45 | + $name = '', |
|
46 | + $description = '', |
|
47 | + $providerId = '', |
|
48 | + $owner = '', |
|
49 | + $ownerDisplayName = '', |
|
50 | + $sharedBy = '', |
|
51 | + $sharedByDisplayName = '', |
|
52 | + $shareType = '', |
|
53 | + $resourceType = '', |
|
54 | + $sharedSecret = '', |
|
55 | + ) { |
|
56 | + $this->setShareWith($shareWith); |
|
57 | + $this->setResourceName($name); |
|
58 | + $this->setDescription($description); |
|
59 | + $this->setProviderId($providerId); |
|
60 | + $this->setOwner($owner); |
|
61 | + $this->setOwnerDisplayName($ownerDisplayName); |
|
62 | + $this->setSharedBy($sharedBy); |
|
63 | + $this->setSharedByDisplayName($sharedByDisplayName); |
|
64 | + $this->setProtocol([ |
|
65 | + 'name' => 'webdav', |
|
66 | + 'options' => [ |
|
67 | + 'sharedSecret' => $sharedSecret, |
|
68 | + 'permissions' => '{http://open-cloud-mesh.org/ns}share-permissions' |
|
69 | + ] |
|
70 | + ]); |
|
71 | + $this->setShareType($shareType); |
|
72 | + $this->setResourceType($resourceType); |
|
73 | + } |
|
74 | 74 | |
75 | - /** |
|
76 | - * set uid of the recipient |
|
77 | - * |
|
78 | - * @param string $user |
|
79 | - * |
|
80 | - * @since 14.0.0 |
|
81 | - */ |
|
82 | - public function setShareWith($user) { |
|
83 | - $this->share['shareWith'] = $user; |
|
84 | - } |
|
75 | + /** |
|
76 | + * set uid of the recipient |
|
77 | + * |
|
78 | + * @param string $user |
|
79 | + * |
|
80 | + * @since 14.0.0 |
|
81 | + */ |
|
82 | + public function setShareWith($user) { |
|
83 | + $this->share['shareWith'] = $user; |
|
84 | + } |
|
85 | 85 | |
86 | - /** |
|
87 | - * set resource name (e.g. document.odt) |
|
88 | - * |
|
89 | - * @param string $name |
|
90 | - * |
|
91 | - * @since 14.0.0 |
|
92 | - */ |
|
93 | - public function setResourceName($name) { |
|
94 | - $this->share['name'] = $name; |
|
95 | - } |
|
86 | + /** |
|
87 | + * set resource name (e.g. document.odt) |
|
88 | + * |
|
89 | + * @param string $name |
|
90 | + * |
|
91 | + * @since 14.0.0 |
|
92 | + */ |
|
93 | + public function setResourceName($name) { |
|
94 | + $this->share['name'] = $name; |
|
95 | + } |
|
96 | 96 | |
97 | - /** |
|
98 | - * set resource type (e.g. file, calendar, contact,...) |
|
99 | - * |
|
100 | - * @param string $resourceType |
|
101 | - * |
|
102 | - * @since 14.0.0 |
|
103 | - */ |
|
104 | - public function setResourceType($resourceType) { |
|
105 | - $this->share['resourceType'] = $resourceType; |
|
106 | - } |
|
97 | + /** |
|
98 | + * set resource type (e.g. file, calendar, contact,...) |
|
99 | + * |
|
100 | + * @param string $resourceType |
|
101 | + * |
|
102 | + * @since 14.0.0 |
|
103 | + */ |
|
104 | + public function setResourceType($resourceType) { |
|
105 | + $this->share['resourceType'] = $resourceType; |
|
106 | + } |
|
107 | 107 | |
108 | - /** |
|
109 | - * set resource description (optional) |
|
110 | - * |
|
111 | - * @param string $description |
|
112 | - * |
|
113 | - * @since 14.0.0 |
|
114 | - */ |
|
115 | - public function setDescription($description) { |
|
116 | - $this->share['description'] = $description; |
|
117 | - } |
|
108 | + /** |
|
109 | + * set resource description (optional) |
|
110 | + * |
|
111 | + * @param string $description |
|
112 | + * |
|
113 | + * @since 14.0.0 |
|
114 | + */ |
|
115 | + public function setDescription($description) { |
|
116 | + $this->share['description'] = $description; |
|
117 | + } |
|
118 | 118 | |
119 | - /** |
|
120 | - * set provider ID (e.g. file ID) |
|
121 | - * |
|
122 | - * @param string $providerId |
|
123 | - * |
|
124 | - * @since 14.0.0 |
|
125 | - */ |
|
126 | - public function setProviderId($providerId) { |
|
127 | - $this->share['providerId'] = (string)$providerId; |
|
128 | - } |
|
119 | + /** |
|
120 | + * set provider ID (e.g. file ID) |
|
121 | + * |
|
122 | + * @param string $providerId |
|
123 | + * |
|
124 | + * @since 14.0.0 |
|
125 | + */ |
|
126 | + public function setProviderId($providerId) { |
|
127 | + $this->share['providerId'] = (string)$providerId; |
|
128 | + } |
|
129 | 129 | |
130 | - /** |
|
131 | - * set owner UID |
|
132 | - * |
|
133 | - * @param string $owner |
|
134 | - * |
|
135 | - * @since 14.0.0 |
|
136 | - */ |
|
137 | - public function setOwner($owner) { |
|
138 | - $this->share['owner'] = $owner; |
|
139 | - } |
|
130 | + /** |
|
131 | + * set owner UID |
|
132 | + * |
|
133 | + * @param string $owner |
|
134 | + * |
|
135 | + * @since 14.0.0 |
|
136 | + */ |
|
137 | + public function setOwner($owner) { |
|
138 | + $this->share['owner'] = $owner; |
|
139 | + } |
|
140 | 140 | |
141 | - /** |
|
142 | - * set owner display name |
|
143 | - * |
|
144 | - * @param string $ownerDisplayName |
|
145 | - * |
|
146 | - * @since 14.0.0 |
|
147 | - */ |
|
148 | - public function setOwnerDisplayName($ownerDisplayName) { |
|
149 | - $this->share['ownerDisplayName'] = $ownerDisplayName; |
|
150 | - } |
|
141 | + /** |
|
142 | + * set owner display name |
|
143 | + * |
|
144 | + * @param string $ownerDisplayName |
|
145 | + * |
|
146 | + * @since 14.0.0 |
|
147 | + */ |
|
148 | + public function setOwnerDisplayName($ownerDisplayName) { |
|
149 | + $this->share['ownerDisplayName'] = $ownerDisplayName; |
|
150 | + } |
|
151 | 151 | |
152 | - /** |
|
153 | - * set UID of the user who sends the share |
|
154 | - * |
|
155 | - * @param string $sharedBy |
|
156 | - * |
|
157 | - * @since 14.0.0 |
|
158 | - */ |
|
159 | - public function setSharedBy($sharedBy) { |
|
160 | - $this->share['sharedBy'] = $sharedBy; |
|
161 | - $this->share['sender'] = $sharedBy; |
|
162 | - } |
|
152 | + /** |
|
153 | + * set UID of the user who sends the share |
|
154 | + * |
|
155 | + * @param string $sharedBy |
|
156 | + * |
|
157 | + * @since 14.0.0 |
|
158 | + */ |
|
159 | + public function setSharedBy($sharedBy) { |
|
160 | + $this->share['sharedBy'] = $sharedBy; |
|
161 | + $this->share['sender'] = $sharedBy; |
|
162 | + } |
|
163 | 163 | |
164 | - /** |
|
165 | - * set display name of the user who sends the share |
|
166 | - * |
|
167 | - * @param $sharedByDisplayName |
|
168 | - * |
|
169 | - * @since 14.0.0 |
|
170 | - */ |
|
171 | - public function setSharedByDisplayName($sharedByDisplayName) { |
|
172 | - $this->share['sharedByDisplayName'] = $sharedByDisplayName; |
|
173 | - $this->share['senderDisplayName'] = $sharedByDisplayName; |
|
174 | - } |
|
164 | + /** |
|
165 | + * set display name of the user who sends the share |
|
166 | + * |
|
167 | + * @param $sharedByDisplayName |
|
168 | + * |
|
169 | + * @since 14.0.0 |
|
170 | + */ |
|
171 | + public function setSharedByDisplayName($sharedByDisplayName) { |
|
172 | + $this->share['sharedByDisplayName'] = $sharedByDisplayName; |
|
173 | + $this->share['senderDisplayName'] = $sharedByDisplayName; |
|
174 | + } |
|
175 | 175 | |
176 | - /** |
|
177 | - * set protocol specification |
|
178 | - * |
|
179 | - * @param array $protocol |
|
180 | - * |
|
181 | - * @since 14.0.0 |
|
182 | - */ |
|
183 | - public function setProtocol(array $protocol) { |
|
184 | - $this->share['protocol'] = $protocol; |
|
185 | - } |
|
176 | + /** |
|
177 | + * set protocol specification |
|
178 | + * |
|
179 | + * @param array $protocol |
|
180 | + * |
|
181 | + * @since 14.0.0 |
|
182 | + */ |
|
183 | + public function setProtocol(array $protocol) { |
|
184 | + $this->share['protocol'] = $protocol; |
|
185 | + } |
|
186 | 186 | |
187 | - /** |
|
188 | - * share type (group or user) |
|
189 | - * |
|
190 | - * @param string $shareType |
|
191 | - * |
|
192 | - * @since 14.0.0 |
|
193 | - */ |
|
194 | - public function setShareType($shareType) { |
|
195 | - if ($shareType === 'group' || $shareType === IShare::TYPE_REMOTE_GROUP) { |
|
196 | - $this->share['shareType'] = 'group'; |
|
197 | - } else { |
|
198 | - $this->share['shareType'] = 'user'; |
|
199 | - } |
|
200 | - } |
|
187 | + /** |
|
188 | + * share type (group or user) |
|
189 | + * |
|
190 | + * @param string $shareType |
|
191 | + * |
|
192 | + * @since 14.0.0 |
|
193 | + */ |
|
194 | + public function setShareType($shareType) { |
|
195 | + if ($shareType === 'group' || $shareType === IShare::TYPE_REMOTE_GROUP) { |
|
196 | + $this->share['shareType'] = 'group'; |
|
197 | + } else { |
|
198 | + $this->share['shareType'] = 'user'; |
|
199 | + } |
|
200 | + } |
|
201 | 201 | |
202 | - /** |
|
203 | - * get the whole share, ready to send out |
|
204 | - * |
|
205 | - * @return array |
|
206 | - * |
|
207 | - * @since 14.0.0 |
|
208 | - */ |
|
209 | - public function getShare() { |
|
210 | - return $this->share; |
|
211 | - } |
|
202 | + /** |
|
203 | + * get the whole share, ready to send out |
|
204 | + * |
|
205 | + * @return array |
|
206 | + * |
|
207 | + * @since 14.0.0 |
|
208 | + */ |
|
209 | + public function getShare() { |
|
210 | + return $this->share; |
|
211 | + } |
|
212 | 212 | |
213 | - /** |
|
214 | - * get uid of the recipient |
|
215 | - * |
|
216 | - * @return string |
|
217 | - * |
|
218 | - * @since 14.0.0 |
|
219 | - */ |
|
220 | - public function getShareWith() { |
|
221 | - return $this->share['shareWith']; |
|
222 | - } |
|
213 | + /** |
|
214 | + * get uid of the recipient |
|
215 | + * |
|
216 | + * @return string |
|
217 | + * |
|
218 | + * @since 14.0.0 |
|
219 | + */ |
|
220 | + public function getShareWith() { |
|
221 | + return $this->share['shareWith']; |
|
222 | + } |
|
223 | 223 | |
224 | - /** |
|
225 | - * get resource name (e.g. file, calendar, contact,...) |
|
226 | - * |
|
227 | - * @return string |
|
228 | - * |
|
229 | - * @since 14.0.0 |
|
230 | - */ |
|
231 | - public function getResourceName() { |
|
232 | - return $this->share['name']; |
|
233 | - } |
|
224 | + /** |
|
225 | + * get resource name (e.g. file, calendar, contact,...) |
|
226 | + * |
|
227 | + * @return string |
|
228 | + * |
|
229 | + * @since 14.0.0 |
|
230 | + */ |
|
231 | + public function getResourceName() { |
|
232 | + return $this->share['name']; |
|
233 | + } |
|
234 | 234 | |
235 | - /** |
|
236 | - * get resource type (e.g. file, calendar, contact,...) |
|
237 | - * |
|
238 | - * @return string |
|
239 | - * |
|
240 | - * @since 14.0.0 |
|
241 | - */ |
|
242 | - public function getResourceType() { |
|
243 | - return $this->share['resourceType']; |
|
244 | - } |
|
235 | + /** |
|
236 | + * get resource type (e.g. file, calendar, contact,...) |
|
237 | + * |
|
238 | + * @return string |
|
239 | + * |
|
240 | + * @since 14.0.0 |
|
241 | + */ |
|
242 | + public function getResourceType() { |
|
243 | + return $this->share['resourceType']; |
|
244 | + } |
|
245 | 245 | |
246 | - /** |
|
247 | - * get resource description (optional) |
|
248 | - * |
|
249 | - * @return string |
|
250 | - * |
|
251 | - * @since 14.0.0 |
|
252 | - */ |
|
253 | - public function getDescription() { |
|
254 | - return $this->share['description']; |
|
255 | - } |
|
246 | + /** |
|
247 | + * get resource description (optional) |
|
248 | + * |
|
249 | + * @return string |
|
250 | + * |
|
251 | + * @since 14.0.0 |
|
252 | + */ |
|
253 | + public function getDescription() { |
|
254 | + return $this->share['description']; |
|
255 | + } |
|
256 | 256 | |
257 | - /** |
|
258 | - * get provider ID (e.g. file ID) |
|
259 | - * |
|
260 | - * @return string |
|
261 | - * |
|
262 | - * @since 14.0.0 |
|
263 | - */ |
|
264 | - public function getProviderId() { |
|
265 | - return $this->share['providerId']; |
|
266 | - } |
|
257 | + /** |
|
258 | + * get provider ID (e.g. file ID) |
|
259 | + * |
|
260 | + * @return string |
|
261 | + * |
|
262 | + * @since 14.0.0 |
|
263 | + */ |
|
264 | + public function getProviderId() { |
|
265 | + return $this->share['providerId']; |
|
266 | + } |
|
267 | 267 | |
268 | - /** |
|
269 | - * get owner UID |
|
270 | - * |
|
271 | - * @return string |
|
272 | - * |
|
273 | - * @since 14.0.0 |
|
274 | - */ |
|
275 | - public function getOwner() { |
|
276 | - return $this->share['owner']; |
|
277 | - } |
|
268 | + /** |
|
269 | + * get owner UID |
|
270 | + * |
|
271 | + * @return string |
|
272 | + * |
|
273 | + * @since 14.0.0 |
|
274 | + */ |
|
275 | + public function getOwner() { |
|
276 | + return $this->share['owner']; |
|
277 | + } |
|
278 | 278 | |
279 | - /** |
|
280 | - * get owner display name |
|
281 | - * |
|
282 | - * @return string |
|
283 | - * |
|
284 | - * @since 14.0.0 |
|
285 | - */ |
|
286 | - public function getOwnerDisplayName() { |
|
287 | - return $this->share['ownerDisplayName']; |
|
288 | - } |
|
279 | + /** |
|
280 | + * get owner display name |
|
281 | + * |
|
282 | + * @return string |
|
283 | + * |
|
284 | + * @since 14.0.0 |
|
285 | + */ |
|
286 | + public function getOwnerDisplayName() { |
|
287 | + return $this->share['ownerDisplayName']; |
|
288 | + } |
|
289 | 289 | |
290 | - /** |
|
291 | - * get UID of the user who sends the share |
|
292 | - * |
|
293 | - * @return string |
|
294 | - * |
|
295 | - * @since 14.0.0 |
|
296 | - */ |
|
297 | - public function getSharedBy() { |
|
298 | - return $this->share['sharedBy']; |
|
299 | - } |
|
290 | + /** |
|
291 | + * get UID of the user who sends the share |
|
292 | + * |
|
293 | + * @return string |
|
294 | + * |
|
295 | + * @since 14.0.0 |
|
296 | + */ |
|
297 | + public function getSharedBy() { |
|
298 | + return $this->share['sharedBy']; |
|
299 | + } |
|
300 | 300 | |
301 | - /** |
|
302 | - * get display name of the user who sends the share |
|
303 | - * |
|
304 | - * @return string |
|
305 | - * |
|
306 | - * @since 14.0.0 |
|
307 | - */ |
|
308 | - public function getSharedByDisplayName() { |
|
309 | - return $this->share['sharedByDisplayName']; |
|
310 | - } |
|
301 | + /** |
|
302 | + * get display name of the user who sends the share |
|
303 | + * |
|
304 | + * @return string |
|
305 | + * |
|
306 | + * @since 14.0.0 |
|
307 | + */ |
|
308 | + public function getSharedByDisplayName() { |
|
309 | + return $this->share['sharedByDisplayName']; |
|
310 | + } |
|
311 | 311 | |
312 | - /** |
|
313 | - * get share type (group or user) |
|
314 | - * |
|
315 | - * @return string |
|
316 | - * |
|
317 | - * @since 14.0.0 |
|
318 | - */ |
|
319 | - public function getShareType() { |
|
320 | - return $this->share['shareType']; |
|
321 | - } |
|
312 | + /** |
|
313 | + * get share type (group or user) |
|
314 | + * |
|
315 | + * @return string |
|
316 | + * |
|
317 | + * @since 14.0.0 |
|
318 | + */ |
|
319 | + public function getShareType() { |
|
320 | + return $this->share['shareType']; |
|
321 | + } |
|
322 | 322 | |
323 | - /** |
|
324 | - * get share Secret |
|
325 | - * |
|
326 | - * @return string |
|
327 | - * |
|
328 | - * @since 14.0.0 |
|
329 | - */ |
|
330 | - public function getShareSecret() { |
|
331 | - return $this->share['protocol']['options']['sharedSecret']; |
|
332 | - } |
|
323 | + /** |
|
324 | + * get share Secret |
|
325 | + * |
|
326 | + * @return string |
|
327 | + * |
|
328 | + * @since 14.0.0 |
|
329 | + */ |
|
330 | + public function getShareSecret() { |
|
331 | + return $this->share['protocol']['options']['sharedSecret']; |
|
332 | + } |
|
333 | 333 | |
334 | - /** |
|
335 | - * get protocol specification |
|
336 | - * |
|
337 | - * @return array |
|
338 | - * |
|
339 | - * @since 14.0.0 |
|
340 | - */ |
|
341 | - public function getProtocol() { |
|
342 | - return $this->share['protocol']; |
|
343 | - } |
|
334 | + /** |
|
335 | + * get protocol specification |
|
336 | + * |
|
337 | + * @return array |
|
338 | + * |
|
339 | + * @since 14.0.0 |
|
340 | + */ |
|
341 | + public function getProtocol() { |
|
342 | + return $this->share['protocol']; |
|
343 | + } |
|
344 | 344 | } |
@@ -124,7 +124,7 @@ |
||
124 | 124 | * @since 14.0.0 |
125 | 125 | */ |
126 | 126 | public function setProviderId($providerId) { |
127 | - $this->share['providerId'] = (string)$providerId; |
|
127 | + $this->share['providerId'] = (string) $providerId; |
|
128 | 128 | } |
129 | 129 | |
130 | 130 | /** |
@@ -16,35 +16,35 @@ |
||
16 | 16 | * @since 14.0.0 |
17 | 17 | */ |
18 | 18 | class CloudFederationNotification implements ICloudFederationNotification { |
19 | - private $message = []; |
|
19 | + private $message = []; |
|
20 | 20 | |
21 | - /** |
|
22 | - * add a message to the notification |
|
23 | - * |
|
24 | - * @param string $notificationType (e.g. SHARE_ACCEPTED) |
|
25 | - * @param string $resourceType (e.g. file, calendar, contact,...) |
|
26 | - * @param string $providerId id of the share |
|
27 | - * @param array $notification payload of the notification |
|
28 | - * |
|
29 | - * @since 14.0.0 |
|
30 | - */ |
|
31 | - public function setMessage($notificationType, $resourceType, $providerId, array $notification) { |
|
32 | - $this->message = [ |
|
33 | - 'notificationType' => $notificationType, |
|
34 | - 'resourceType' => $resourceType, |
|
35 | - 'providerId' => (string)$providerId, |
|
36 | - 'notification' => $notification, |
|
37 | - ]; |
|
38 | - } |
|
21 | + /** |
|
22 | + * add a message to the notification |
|
23 | + * |
|
24 | + * @param string $notificationType (e.g. SHARE_ACCEPTED) |
|
25 | + * @param string $resourceType (e.g. file, calendar, contact,...) |
|
26 | + * @param string $providerId id of the share |
|
27 | + * @param array $notification payload of the notification |
|
28 | + * |
|
29 | + * @since 14.0.0 |
|
30 | + */ |
|
31 | + public function setMessage($notificationType, $resourceType, $providerId, array $notification) { |
|
32 | + $this->message = [ |
|
33 | + 'notificationType' => $notificationType, |
|
34 | + 'resourceType' => $resourceType, |
|
35 | + 'providerId' => (string)$providerId, |
|
36 | + 'notification' => $notification, |
|
37 | + ]; |
|
38 | + } |
|
39 | 39 | |
40 | - /** |
|
41 | - * get message, ready to send out |
|
42 | - * |
|
43 | - * @return array |
|
44 | - * |
|
45 | - * @since 14.0.0 |
|
46 | - */ |
|
47 | - public function getMessage() { |
|
48 | - return $this->message; |
|
49 | - } |
|
40 | + /** |
|
41 | + * get message, ready to send out |
|
42 | + * |
|
43 | + * @return array |
|
44 | + * |
|
45 | + * @since 14.0.0 |
|
46 | + */ |
|
47 | + public function getMessage() { |
|
48 | + return $this->message; |
|
49 | + } |
|
50 | 50 | } |
@@ -32,7 +32,7 @@ |
||
32 | 32 | $this->message = [ |
33 | 33 | 'notificationType' => $notificationType, |
34 | 34 | 'resourceType' => $resourceType, |
35 | - 'providerId' => (string)$providerId, |
|
35 | + 'providerId' => (string) $providerId, |
|
36 | 36 | 'notification' => $notification, |
37 | 37 | ]; |
38 | 38 | } |