1 | <?php |
||
72 | class CircleService { |
||
73 | |||
74 | |||
75 | use TArrayTools; |
||
76 | use TStringTools; |
||
77 | |||
78 | |||
79 | /** @var CircleRequest */ |
||
80 | private $circleRequest; |
||
81 | |||
82 | /** @var MemberRequest */ |
||
83 | private $memberRequest; |
||
84 | |||
85 | /** @var RemoteStreamService */ |
||
86 | private $remoteStreamService; |
||
87 | |||
88 | /** @var FederatedUserService */ |
||
89 | private $federatedUserService; |
||
90 | |||
91 | /** @var FederatedEventService */ |
||
92 | private $federatedEventService; |
||
93 | |||
94 | /** @var MemberService */ |
||
95 | private $memberService; |
||
96 | |||
97 | /** @var ConfigService */ |
||
98 | private $configService; |
||
99 | |||
100 | |||
101 | /** |
||
102 | * CircleService constructor. |
||
103 | * |
||
104 | * @param CircleRequest $circleRequest |
||
105 | * @param MemberRequest $memberRequest |
||
106 | * @param RemoteStreamService $remoteStreamService |
||
107 | * @param FederatedUserService $federatedUserService |
||
108 | * @param FederatedEventService $federatedEventService |
||
109 | * @param MemberService $memberService |
||
110 | * @param ConfigService $configService |
||
111 | */ |
||
112 | public function __construct( |
||
125 | |||
126 | |||
127 | /** |
||
128 | * @param string $name |
||
129 | * @param FederatedUser|null $owner |
||
130 | * @param bool $personal |
||
131 | * @param bool $local |
||
132 | * |
||
133 | * @return array |
||
134 | * @throws FederatedEventException |
||
135 | * @throws FederatedItemException |
||
136 | * @throws InitiatorNotConfirmedException |
||
137 | * @throws InitiatorNotFoundException |
||
138 | * @throws OwnerNotFoundException |
||
139 | * @throws RemoteInstanceException |
||
140 | * @throws RemoteNotFoundException |
||
141 | * @throws RemoteResourceNotFoundException |
||
142 | * @throws UnknownRemoteException |
||
143 | * @throws RequestBuilderException |
||
144 | */ |
||
145 | public function create( |
||
194 | |||
195 | |||
196 | /** |
||
197 | * @param string $circleId |
||
198 | * |
||
199 | * @return array |
||
200 | * @throws CircleNotFoundException |
||
201 | * @throws FederatedEventException |
||
202 | * @throws FederatedItemException |
||
203 | * @throws InitiatorNotConfirmedException |
||
204 | * @throws InitiatorNotFoundException |
||
205 | * @throws OwnerNotFoundException |
||
206 | * @throws RemoteInstanceException |
||
207 | * @throws RemoteNotFoundException |
||
208 | * @throws RemoteResourceNotFoundException |
||
209 | * @throws RequestBuilderException |
||
210 | * @throws UnknownRemoteException |
||
211 | */ |
||
212 | public function destroy(string $circleId): array { |
||
223 | |||
224 | |||
225 | /** |
||
226 | * @param string $circleId |
||
227 | * @param int $config |
||
228 | * |
||
229 | * @return array |
||
230 | * @throws CircleNotFoundException |
||
231 | * @throws FederatedEventException |
||
232 | * @throws FederatedItemException |
||
233 | * @throws InitiatorNotConfirmedException |
||
234 | * @throws InitiatorNotFoundException |
||
235 | * @throws OwnerNotFoundException |
||
236 | * @throws RemoteInstanceException |
||
237 | * @throws RemoteNotFoundException |
||
238 | * @throws RemoteResourceNotFoundException |
||
239 | * @throws UnknownRemoteException |
||
240 | * @throws RequestBuilderException |
||
241 | */ |
||
242 | public function updateConfig(string $circleId, int $config): array { |
||
253 | |||
254 | |||
255 | /** |
||
256 | * @param string $circleId |
||
257 | * @param string $displayName |
||
258 | * |
||
259 | * @return array |
||
260 | * @throws CircleNotFoundException |
||
261 | * @throws FederatedEventException |
||
262 | * @throws FederatedItemException |
||
263 | * @throws InitiatorNotConfirmedException |
||
264 | * @throws InitiatorNotFoundException |
||
265 | * @throws OwnerNotFoundException |
||
266 | * @throws RemoteInstanceException |
||
267 | * @throws RemoteNotFoundException |
||
268 | * @throws RemoteResourceNotFoundException |
||
269 | * @throws RequestBuilderException |
||
270 | * @throws UnknownRemoteException |
||
271 | */ |
||
272 | public function updateDisplayName(string $circleId, string $displayName): array { |
||
283 | |||
284 | /** |
||
285 | * @param string $circleId |
||
286 | * @param string $description |
||
287 | * |
||
288 | * @return array |
||
289 | * @throws CircleNotFoundException |
||
290 | * @throws FederatedEventException |
||
291 | * @throws FederatedItemException |
||
292 | * @throws InitiatorNotConfirmedException |
||
293 | * @throws InitiatorNotFoundException |
||
294 | * @throws OwnerNotFoundException |
||
295 | * @throws RemoteInstanceException |
||
296 | * @throws RemoteNotFoundException |
||
297 | * @throws RemoteResourceNotFoundException |
||
298 | * @throws RequestBuilderException |
||
299 | * @throws UnknownRemoteException |
||
300 | */ |
||
301 | public function updateDescription(string $circleId, string $description): array { |
||
312 | |||
313 | /** |
||
314 | * @param string $circleId |
||
315 | * @param array $settings |
||
316 | * |
||
317 | * @return array |
||
318 | * @throws CircleNotFoundException |
||
319 | * @throws FederatedEventException |
||
320 | * @throws FederatedItemException |
||
321 | * @throws InitiatorNotConfirmedException |
||
322 | * @throws InitiatorNotFoundException |
||
323 | * @throws OwnerNotFoundException |
||
324 | * @throws RemoteInstanceException |
||
325 | * @throws RemoteNotFoundException |
||
326 | * @throws RemoteResourceNotFoundException |
||
327 | * @throws RequestBuilderException |
||
328 | * @throws UnknownRemoteException |
||
329 | */ |
||
330 | public function updateSettings(string $circleId, array $settings): array { |
||
341 | |||
342 | |||
343 | /** |
||
344 | * @param string $circleId |
||
345 | * |
||
346 | * @return array |
||
347 | * @throws CircleNotFoundException |
||
348 | * @throws FederatedEventException |
||
349 | * @throws FederatedItemException |
||
350 | * @throws InitiatorNotConfirmedException |
||
351 | * @throws InitiatorNotFoundException |
||
352 | * @throws OwnerNotFoundException |
||
353 | * @throws RemoteInstanceException |
||
354 | * @throws RemoteNotFoundException |
||
355 | * @throws RemoteResourceNotFoundException |
||
356 | * @throws UnknownRemoteException |
||
357 | * @throws RequestBuilderException |
||
358 | */ |
||
359 | public function circleJoin(string $circleId): array { |
||
371 | |||
372 | |||
373 | /** |
||
374 | * @param string $circleId |
||
375 | * |
||
376 | * @return array |
||
377 | * @throws CircleNotFoundException |
||
378 | * @throws FederatedEventException |
||
379 | * @throws FederatedItemException |
||
380 | * @throws InitiatorNotConfirmedException |
||
381 | * @throws InitiatorNotFoundException |
||
382 | * @throws OwnerNotFoundException |
||
383 | * @throws RemoteInstanceException |
||
384 | * @throws RemoteNotFoundException |
||
385 | * @throws RemoteResourceNotFoundException |
||
386 | * @throws UnknownRemoteException |
||
387 | */ |
||
388 | public function circleLeave(string $circleId): array { |
||
400 | |||
401 | |||
402 | /** |
||
403 | * @param string $circleId |
||
404 | * @param int $filter |
||
405 | * |
||
406 | * @return Circle |
||
407 | * @throws CircleNotFoundException |
||
408 | * @throws InitiatorNotFoundException |
||
409 | * @throws RequestBuilderException |
||
410 | */ |
||
411 | public function getCircle( |
||
424 | |||
425 | |||
426 | /** |
||
427 | * @param Circle|null $circleFilter |
||
428 | * @param Member|null $memberFilter |
||
429 | * @param SimpleDataStore|null $params |
||
430 | * |
||
431 | * @return Circle[] |
||
432 | * @throws InitiatorNotFoundException |
||
433 | * @throws RequestBuilderException |
||
434 | */ |
||
435 | public function getCircles( |
||
465 | |||
466 | |||
467 | /** |
||
468 | * @param Circle $circle |
||
469 | * |
||
470 | * @throws RequestBuilderException |
||
471 | */ |
||
472 | public function confirmName(Circle $circle): void { |
||
481 | |||
482 | /** |
||
483 | * @param Circle $circle |
||
484 | * |
||
485 | * @throws RequestBuilderException |
||
486 | */ |
||
487 | private function confirmDisplayName(Circle $circle) { |
||
510 | |||
511 | |||
512 | /** |
||
513 | * @param Circle $circle |
||
514 | * |
||
515 | * @throws RequestBuilderException |
||
516 | */ |
||
517 | private function confirmSanitizedName(Circle $circle) { |
||
544 | |||
545 | /** |
||
546 | * @param string $name |
||
547 | * |
||
548 | * @return string |
||
549 | */ |
||
550 | public function sanitizeName(string $name): string { |
||
561 | |||
562 | |||
563 | /** |
||
564 | * @param Circle $circle |
||
565 | * |
||
566 | * @throws MembersLimitException |
||
567 | */ |
||
568 | public function confirmCircleNotFull(Circle $circle): void { |
||
573 | |||
574 | |||
575 | /** |
||
576 | * @param Circle $circle |
||
577 | * |
||
578 | * @return bool |
||
579 | */ |
||
580 | public function isCircleFull(Circle $circle): bool { |
||
595 | |||
596 | } |
||
597 | |||
598 |
This check looks for access to properties that are not accessible from the current context.
If you need to make a property accessible to another context you can either raise its visibility level or provide an accessible getter in the defining class.