| @@ 422-427 (lines=6) @@ | ||
| 419 | */ |
|
| 420 | public function removeCircle($circleUniqueId, bool $force = false) { |
|
| 421 | ||
| 422 | if ($force) { |
|
| 423 | $circle = $this->circlesRequest->forceGetCircle($circleUniqueId); |
|
| 424 | } else { |
|
| 425 | $circle = $this->circlesRequest->getCircle($circleUniqueId, $this->userId); |
|
| 426 | $this->hasToBeOwner($circle->getHigherViewer()); |
|
| 427 | } |
|
| 428 | ||
| 429 | $this->eventsService->onCircleDestruction($circle); |
|
| 430 | ||
| @@ 155-161 (lines=7) @@ | ||
| 152 | * @throws Exception |
|
| 153 | */ |
|
| 154 | public function addMember($circleUniqueId, $ident, $type, string $instance, bool $force = false) { |
|
| 155 | if ($force === true) { |
|
| 156 | $circle = $this->circlesRequest->forceGetCircle($circleUniqueId); |
|
| 157 | } else { |
|
| 158 | $circle = $this->circlesRequest->getCircle($circleUniqueId, $this->userId); |
|
| 159 | $circle->getHigherViewer() |
|
| 160 | ->hasToBeModerator(); |
|
| 161 | } |
|
| 162 | ||
| 163 | if (!$this->addMassiveMembers($circle, $ident, $type)) { |
|
| 164 | $this->addSingleMember($circle, $ident, $type, $instance, $force); |
|
| @@ 580-586 (lines=7) @@ | ||
| 577 | string $circleUniqueId, string $name, int $type, string $instance, bool $force = false |
|
| 578 | ): array { |
|
| 579 | ||
| 580 | if ($force === false) { |
|
| 581 | $circle = $this->circlesRequest->getCircle($circleUniqueId, $this->userId); |
|
| 582 | $circle->getHigherViewer() |
|
| 583 | ->hasToBeModerator(); |
|
| 584 | } else { |
|
| 585 | $circle = $this->circlesRequest->forceGetCircle($circleUniqueId); |
|
| 586 | } |
|
| 587 | ||
| 588 | $member = $this->membersRequest->forceGetMember($circleUniqueId, $name, $type, $instance); |
|
| 589 | ||