| @@ 233-246 (lines=14) @@ | ||
| 230 | * @throws MemberAlreadyExistsException |
|
| 231 | * @throws MemberIsBlockedException |
|
| 232 | */ |
|
| 233 | public function hasToBeAbleToJoinTheCircle() { |
|
| 234 | ||
| 235 | if ($this->getLevel() > 0) { |
|
| 236 | throw new MemberAlreadyExistsException( |
|
| 237 | $this->l10n->t("You are already a member of this circle") |
|
| 238 | ); |
|
| 239 | } |
|
| 240 | ||
| 241 | if ($this->getStatus() === Member::STATUS_BLOCKED) { |
|
| 242 | throw new MemberIsBlockedException( |
|
| 243 | $this->l10n->t("You have been blocked from this circle") |
|
| 244 | ); |
|
| 245 | } |
|
| 246 | } |
|
| 247 | ||
| 248 | ||
| 249 | /** |
|
| @@ 252-265 (lines=14) @@ | ||
| 249 | /** |
|
| 250 | * @throws MemberAlreadyExistsException |
|
| 251 | */ |
|
| 252 | public function hasToBeInviteAble() { |
|
| 253 | ||
| 254 | if ($this->getLevel() > 0) { |
|
| 255 | throw new MemberAlreadyExistsException( |
|
| 256 | $this->l10n->t("The user is already a member of this circle") |
|
| 257 | ); |
|
| 258 | } |
|
| 259 | ||
| 260 | if ($this->getStatus() === Member::STATUS_INVITED) { |
|
| 261 | throw new MemberAlreadyExistsException( |
|
| 262 | $this->l10n->t("The user has already been invited into this circle") |
|
| 263 | ); |
|
| 264 | } |
|
| 265 | } |
|
| 266 | ||
| 267 | } |
|
| 268 | ||