| @@ 109-124 (lines=16) @@ | ||
| 106 | * @return array |
|
| 107 | * @throws \Exception |
|
| 108 | */ |
|
| 109 | public function addMember($circleUniqueId, $ident, $type) { |
|
| 110 | ||
| 111 | try { |
|
| 112 | $circle = $this->circlesRequest->getCircle($circleUniqueId, $this->userId); |
|
| 113 | $circle->getHigherViewer() |
|
| 114 | ->hasToBeModerator(); |
|
| 115 | ||
| 116 | if (!$this->addMassiveMembers($circle, $ident, $type)) { |
|
| 117 | $this->addSingleMember($circle, $ident, $type); |
|
| 118 | } |
|
| 119 | } catch (\Exception $e) { |
|
| 120 | throw $e; |
|
| 121 | } |
|
| 122 | ||
| 123 | return $this->membersRequest->getMembers($circle->getUniqueId(), $circle->getHigherViewer()); |
|
| 124 | } |
|
| 125 | ||
| 126 | ||
| 127 | /** |
|
| @@ 128-144 (lines=17) @@ | ||
| 125 | * @throws Exception |
|
| 126 | * @throws MemberDoesNotExistException |
|
| 127 | */ |
|
| 128 | public function createFrame($circleUniqueId, SharingFrame $frame, $broadcast = null) { |
|
| 129 | ||
| 130 | try { |
|
| 131 | $circle = $this->circlesRequest->getCircle($circleUniqueId, $this->userId); |
|
| 132 | $circle->getHigherViewer() |
|
| 133 | ->hasToBeMember(); |
|
| 134 | ||
| 135 | $frame->setCircle($circle); |
|
| 136 | ||
| 137 | $this->generateHeaders($frame, $circle, $broadcast); |
|
| 138 | $this->sharingFrameRequest->saveSharingFrame($frame); |
|
| 139 | ||
| 140 | $this->initiateShare($circle->getUniqueId(), $frame->getUniqueId()); |
|
| 141 | } catch (Exception $e) { |
|
| 142 | throw $e; |
|
| 143 | } |
|
| 144 | } |
|
| 145 | ||
| 146 | ||
| 147 | /** |
|