1 | <?php |
||
63 | class CirclesManager { |
||
64 | |||
65 | |||
66 | /** @var IUserSession */ |
||
67 | private $userSession; |
||
68 | |||
69 | /** @var FederatedUserService */ |
||
70 | private $federatedUserService; |
||
71 | |||
72 | /** @var CircleService */ |
||
73 | private $circleService; |
||
74 | |||
75 | /** @var MemberService */ |
||
76 | private $memberService; |
||
77 | |||
78 | |||
79 | /** |
||
80 | * CirclesManager constructor. |
||
81 | * |
||
82 | * @param IUserSession $userSession |
||
83 | * @param FederatedUserService $federatedUserService |
||
84 | * @param CircleService $circleService |
||
85 | * @param MemberService $memberService |
||
86 | */ |
||
87 | public function __construct( |
||
98 | |||
99 | |||
100 | /** |
||
101 | * WIP |
||
102 | * |
||
103 | * @return Circle |
||
104 | */ |
||
105 | // public function create(): Circle { |
||
106 | // } |
||
107 | |||
108 | |||
109 | /** |
||
110 | * WIP |
||
111 | * |
||
112 | * returns Circles available to Current User |
||
113 | * |
||
114 | * @return Circle[] |
||
115 | * @throws InitiatorNotFoundException |
||
116 | * @throws FederatedUserException |
||
117 | * @throws FederatedUserNotFoundException |
||
118 | * @throws InvalidIdException |
||
119 | * @throws RequestBuilderException |
||
120 | * @throws SingleCircleNotFoundException |
||
121 | */ |
||
122 | // public function getCircles(bool $asMember = false): array { |
||
123 | // $this->federatedUserService->initCurrentUser(); |
||
124 | // $this->circleService->getCircles(); |
||
125 | // } |
||
126 | |||
127 | |||
128 | /** |
||
129 | * WIP |
||
130 | * |
||
131 | * @return Circle[] |
||
132 | * @throws InitiatorNotFoundException |
||
133 | * @throws RequestBuilderException |
||
134 | */ |
||
135 | // public function getAllCircles(): array { |
||
136 | // $this->federatedUserService->bypassCurrentUserCondition(true); |
||
137 | // $this->circleService->getCircles(); |
||
138 | // } |
||
139 | |||
140 | |||
141 | /** |
||
142 | * WIP |
||
143 | * |
||
144 | * @param string $singleId |
||
145 | * |
||
146 | * @return Circle |
||
147 | */ |
||
148 | // public function getCircle(string $singleId): Circle { |
||
149 | // |
||
150 | // } |
||
151 | |||
152 | |||
153 | /** |
||
154 | * WIP |
||
155 | * |
||
156 | * @param string $circleId |
||
157 | * @param string $singleId |
||
158 | * |
||
159 | * @return Member |
||
160 | * @throws InitiatorNotFoundException |
||
161 | * @throws MemberNotFoundException |
||
162 | * @throws RequestBuilderException |
||
163 | */ |
||
164 | // public function getMember(string $circleId, string $singleId): Member { |
||
165 | // $this->federatedUserService->bypassCurrentUserCondition(true); |
||
166 | // $this->memberService->getMemberById($circleId, $singleId); |
||
167 | // } |
||
168 | |||
169 | |||
170 | /** |
||
171 | * WIP |
||
172 | * |
||
173 | * @param string $memberId |
||
174 | * |
||
175 | * @return Member |
||
176 | */ |
||
177 | // public function getMemberById(string $memberId): Member { |
||
178 | // } |
||
179 | |||
180 | |||
181 | /** |
||
182 | * WIP |
||
183 | * |
||
184 | * @return IFederatedUser |
||
185 | * @throws FederatedUserException |
||
186 | * @throws FederatedUserNotFoundException |
||
187 | * @throws InvalidIdException |
||
188 | * @throws RequestBuilderException |
||
189 | * @throws SingleCircleNotFoundException |
||
190 | */ |
||
191 | // public function getCurrentFederatedUser(): IFederatedUser { |
||
192 | // $user = $this->userSession->getUser(); |
||
193 | // if ($user === null) { |
||
194 | // throw new FederatedUserNotFoundException('current user session not found'); |
||
195 | // } |
||
196 | // |
||
197 | // return $this->federatedUserService->getLocalFederatedUser($user->getUID()); |
||
198 | // } |
||
199 | |||
200 | |||
201 | /** |
||
202 | * @param string $federatedId |
||
203 | * @param int $type |
||
204 | * |
||
205 | * @return IFederatedUser |
||
206 | * @throws CircleNotFoundException |
||
207 | * @throws FederatedItemException |
||
208 | * @throws FederatedUserException |
||
209 | * @throws FederatedUserNotFoundException |
||
210 | * @throws InvalidIdException |
||
211 | * @throws MemberNotFoundException |
||
212 | * @throws OwnerNotFoundException |
||
213 | * @throws RemoteInstanceException |
||
214 | * @throws RemoteNotFoundException |
||
215 | * @throws RemoteResourceNotFoundException |
||
216 | * @throws RequestBuilderException |
||
217 | * @throws SingleCircleNotFoundException |
||
218 | * @throws UnknownRemoteException |
||
219 | * @throws UserTypeNotFoundException |
||
220 | */ |
||
221 | public function getFederatedUser(string $federatedId, int $type = Member::TYPE_SINGLE): IFederatedUser { |
||
224 | |||
225 | } |
||
226 | |||
227 |