| @@ 418-423 (lines=6) @@ | ||
| 415 | */ |
|
| 416 | public function removeCircle($circleUniqueId, bool $force = false) { |
|
| 417 | ||
| 418 | if ($force) { |
|
| 419 | $circle = $this->circlesRequest->forceGetCircle($circleUniqueId); |
|
| 420 | } else { |
|
| 421 | $circle = $this->circlesRequest->getCircle($circleUniqueId, $this->userId); |
|
| 422 | $this->hasToBeOwner($circle->getHigherViewer()); |
|
| 423 | } |
|
| 424 | ||
| 425 | ||
| 426 | $this->eventsService->onCircleDestruction($circle); |
|
| @@ 153-159 (lines=7) @@ | ||
| 150 | */ |
|
| 151 | public function addMember($circleUniqueId, $ident, $type, bool $force = false) { |
|
| 152 | ||
| 153 | if ($force === true) { |
|
| 154 | $circle = $this->circlesRequest->forceGetCircle($circleUniqueId); |
|
| 155 | } else { |
|
| 156 | $circle = $this->circlesRequest->getCircle($circleUniqueId, $this->userId); |
|
| 157 | $circle->getHigherViewer() |
|
| 158 | ->hasToBeModerator(); |
|
| 159 | } |
|
| 160 | ||
| 161 | if (!$this->addMassiveMembers($circle, $ident, $type)) { |
|
| 162 | $this->addSingleMember($circle, $ident, $type); |
|
| @@ 654-660 (lines=7) @@ | ||
| 651 | */ |
|
| 652 | public function removeMember($circleUniqueId, $name, $type, bool $force = false) { |
|
| 653 | ||
| 654 | if ($force === false) { |
|
| 655 | $circle = $this->circlesRequest->getCircle($circleUniqueId, $this->userId); |
|
| 656 | $circle->getHigherViewer() |
|
| 657 | ->hasToBeModerator(); |
|
| 658 | } else { |
|
| 659 | $circle = $this->circlesRequest->forceGetCircle($circleUniqueId); |
|
| 660 | } |
|
| 661 | ||
| 662 | $member = $this->membersRequest->forceGetMember($circleUniqueId, $name, $type); |
|
| 663 | $member->hasToBeMemberOrAlmost(); |
|