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