1 | <?php |
||
26 | class CloudFederationShare implements ICloudFederationShare { |
||
27 | |||
28 | private $share = [ |
||
29 | 'shareWith' => '', |
||
30 | 'shareType' => '', |
||
31 | 'name' => '', |
||
32 | 'resourceType' => '', |
||
33 | 'description' => '', |
||
34 | 'providerId' => '', |
||
35 | 'owner' => '', |
||
36 | 'ownerDisplayName' => '', |
||
37 | 'sharedBy' => '', |
||
38 | 'sharedByDisplayName' => '', |
||
39 | 'protocol' => [] |
||
40 | ]; |
||
41 | |||
42 | /** |
||
43 | * get a CloudFederationShare Object to prepare a share you want to send |
||
44 | * |
||
45 | * @param string $shareWith |
||
46 | * @param string $name resource name (e.g. document.odt) |
||
47 | * @param string $description share description (optional) |
||
48 | * @param string $providerId resource UID on the provider side |
||
49 | * @param string $owner provider specific UID of the user who owns the resource |
||
50 | * @param string $ownerDisplayName display name of the user who shared the item |
||
51 | * @param string $sharedBy provider specific UID of the user who shared the resource |
||
52 | * @param string $sharedByDisplayName display name of the user who shared the resource |
||
53 | * @param string $shareType ('group' or 'user' share) |
||
54 | * @param string $resourceType ('file', 'calendar',...) |
||
55 | * @param string $sharedSecret |
||
56 | */ |
||
57 | public function __construct($shareWith = '', |
||
88 | |||
89 | /** |
||
90 | * set uid of the recipient |
||
91 | * |
||
92 | * @param string $user |
||
93 | * |
||
94 | * @since 14.0.0 |
||
95 | */ |
||
96 | public function setShareWith($user) { |
||
99 | |||
100 | /** |
||
101 | * set resource name (e.g. document.odt) |
||
102 | * |
||
103 | * @param string $name |
||
104 | * |
||
105 | * @since 14.0.0 |
||
106 | */ |
||
107 | public function setResourceName($name) { |
||
110 | |||
111 | /** |
||
112 | * set resource type (e.g. file, calendar, contact,...) |
||
113 | * |
||
114 | * @param string $resourceType |
||
115 | * |
||
116 | * @since 14.0.0 |
||
117 | */ |
||
118 | public function setResourceType($resourceType) { |
||
121 | |||
122 | /** |
||
123 | * set resource description (optional) |
||
124 | * |
||
125 | * @param string $description |
||
126 | * |
||
127 | * @since 14.0.0 |
||
128 | */ |
||
129 | public function setDescription($description) { |
||
132 | |||
133 | /** |
||
134 | * set provider ID (e.g. file ID) |
||
135 | * |
||
136 | * @param string $providerId |
||
137 | * |
||
138 | * @since 14.0.0 |
||
139 | */ |
||
140 | public function setProviderId($providerId) { |
||
143 | |||
144 | /** |
||
145 | * set owner UID |
||
146 | * |
||
147 | * @param string $owner |
||
148 | * |
||
149 | * @since 14.0.0 |
||
150 | */ |
||
151 | public function setOwner($owner) { |
||
154 | |||
155 | /** |
||
156 | * set owner display name |
||
157 | * |
||
158 | * @param string $ownerDisplayName |
||
159 | * |
||
160 | * @since 14.0.0 |
||
161 | */ |
||
162 | public function setOwnerDisplayName($ownerDisplayName) { |
||
165 | |||
166 | /** |
||
167 | * set UID of the user who sends the share |
||
168 | * |
||
169 | * @param string $sharedBy |
||
170 | * |
||
171 | * @since 14.0.0 |
||
172 | */ |
||
173 | public function setSharedBy($sharedBy) { |
||
176 | |||
177 | /** |
||
178 | * set display name of the user who sends the share |
||
179 | * |
||
180 | * @param $sharedByDisplayName |
||
181 | * |
||
182 | * @since 14.0.0 |
||
183 | */ |
||
184 | public function setSharedByDisplayName($sharedByDisplayName) { |
||
187 | |||
188 | /** |
||
189 | * set protocol specification |
||
190 | * |
||
191 | * @param array $protocol |
||
192 | * |
||
193 | * @since 14.0.0 |
||
194 | */ |
||
195 | public function setProtocol(array $protocol) { |
||
198 | |||
199 | /** |
||
200 | * share type (group or user) |
||
201 | * |
||
202 | * @param string $shareType |
||
203 | * |
||
204 | * @since 14.0.0 |
||
205 | */ |
||
206 | public function setShareType($shareType) { |
||
209 | |||
210 | /** |
||
211 | * get the whole share, ready to send out |
||
212 | * |
||
213 | * @return array |
||
214 | * |
||
215 | * @since 14.0.0 |
||
216 | */ |
||
217 | public function getShare() { |
||
220 | |||
221 | /** |
||
222 | * get uid of the recipient |
||
223 | * |
||
224 | * @return string |
||
225 | * |
||
226 | * @since 14.0.0 |
||
227 | */ |
||
228 | public function getShareWith() { |
||
231 | |||
232 | /** |
||
233 | * get resource name (e.g. file, calendar, contact,...) |
||
234 | * |
||
235 | * @return string |
||
236 | * |
||
237 | * @since 14.0.0 |
||
238 | */ |
||
239 | public function getResourceName() { |
||
242 | |||
243 | /** |
||
244 | * get resource type (e.g. file, calendar, contact,...) |
||
245 | * |
||
246 | * @return string |
||
247 | * |
||
248 | * @since 14.0.0 |
||
249 | */ |
||
250 | public function getResourceType() { |
||
253 | |||
254 | /** |
||
255 | * get resource description (optional) |
||
256 | * |
||
257 | * @return string |
||
258 | * |
||
259 | * @since 14.0.0 |
||
260 | */ |
||
261 | public function getDescription() { |
||
264 | |||
265 | /** |
||
266 | * get provider ID (e.g. file ID) |
||
267 | * |
||
268 | * @return string |
||
269 | * |
||
270 | * @since 14.0.0 |
||
271 | */ |
||
272 | public function getProviderId() { |
||
275 | |||
276 | /** |
||
277 | * get owner UID |
||
278 | * |
||
279 | * @return string |
||
280 | * |
||
281 | * @since 14.0.0 |
||
282 | */ |
||
283 | public function getOwner() { |
||
286 | |||
287 | /** |
||
288 | * get owner display name |
||
289 | * |
||
290 | * @return string |
||
291 | * |
||
292 | * @since 14.0.0 |
||
293 | */ |
||
294 | public function getOwnerDisplayName() { |
||
297 | |||
298 | /** |
||
299 | * get UID of the user who sends the share |
||
300 | * |
||
301 | * @return string |
||
302 | * |
||
303 | * @since 14.0.0 |
||
304 | */ |
||
305 | public function getSharedBy() { |
||
308 | |||
309 | /** |
||
310 | * get display name of the user who sends the share |
||
311 | * |
||
312 | * @return string |
||
313 | * |
||
314 | * @since 14.0.0 |
||
315 | */ |
||
316 | public function getSharedByDisplayName() { |
||
319 | |||
320 | /** |
||
321 | * get share type (group or user) |
||
322 | * |
||
323 | * @return string |
||
324 | * |
||
325 | * @since 14.0.0 |
||
326 | */ |
||
327 | public function getShareType() { |
||
330 | |||
331 | /** |
||
332 | * get share Secret |
||
333 | * |
||
334 | * @return string |
||
335 | * |
||
336 | * @since 14.0.0 |
||
337 | */ |
||
338 | public function getShareSecret() { |
||
341 | |||
342 | /** |
||
343 | * get protocol specification |
||
344 | * |
||
345 | * @return array |
||
346 | * |
||
347 | * @since 14.0.0 |
||
348 | */ |
||
349 | public function getProtocol() { |
||
352 | } |
||
353 |