| @@ 436-441 (lines=6) @@ | ||
| 433 | */ |
|
| 434 | public function removeCircle($circleUniqueId, bool $force = false) { |
|
| 435 | ||
| 436 | if ($force) { |
|
| 437 | $circle = $this->circlesRequest->forceGetCircle($circleUniqueId); |
|
| 438 | } else { |
|
| 439 | $circle = $this->circlesRequest->getCircle($circleUniqueId, $this->userId); |
|
| 440 | $this->hasToBeOwner($circle->getHigherViewer()); |
|
| 441 | } |
|
| 442 | ||
| 443 | $this->eventsService->onCircleDestruction($circle); |
|
| 444 | ||
| @@ 156-162 (lines=7) @@ | ||
| 153 | * @throws Exception |
|
| 154 | */ |
|
| 155 | public function addMember($circleUniqueId, $ident, $type, string $instance, bool $force = false) { |
|
| 156 | if ($force === true) { |
|
| 157 | $circle = $this->circlesRequest->forceGetCircle($circleUniqueId); |
|
| 158 | } else { |
|
| 159 | $circle = $this->circlesRequest->getCircle($circleUniqueId, $this->userId); |
|
| 160 | $circle->getHigherViewer() |
|
| 161 | ->hasToBeModerator(); |
|
| 162 | } |
|
| 163 | ||
| 164 | if (!$this->addMassiveMembers($circle, $ident, $type)) { |
|
| 165 | $this->addSingleMember($circle, $ident, $type, $instance); |
|
| @@ 569-575 (lines=7) @@ | ||
| 566 | */ |
|
| 567 | public function removeMember(string $circleUniqueId, string $name, int $type, string $instance, bool $force = false): array { |
|
| 568 | ||
| 569 | if ($force === false) { |
|
| 570 | $circle = $this->circlesRequest->getCircle($circleUniqueId, $this->userId); |
|
| 571 | $circle->getHigherViewer() |
|
| 572 | ->hasToBeModerator(); |
|
| 573 | } else { |
|
| 574 | $circle = $this->circlesRequest->forceGetCircle($circleUniqueId); |
|
| 575 | } |
|
| 576 | ||
| 577 | $member = $this->membersRequest->forceGetMember($circleUniqueId, $name, $type, $instance); |
|
| 578 | ||