ここの情報は古いです。ご理解頂いた上でお取り扱いください。

Changeset 8123


Ignore:
Timestamp:
Aug 27, 2008, 4:18:17 PM (12 years ago)
Author:
ebihara
Message:

#2912:コミュニティへの参加・退会がおこなえない場合例外を投げるようにした

File:
1 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE3/trunk/lib/model/CommunityMemberPeer.php

    r7861 r8123  
    3939  public static function join($memberId, $communityId)
    4040  {
     41    if (self::isMember($memberId, $communityId)) {
     42      throw new Exception('This member has already joined this community.');
     43    }
     44
    4145    $communityMember = new CommunityMember();
    4246    $communityMember->setMemberId($memberId);
     
    4751  public static function quit($memberId, $communityId)
    4852  {
     53    if (!self::isMember($memberId, $communityId)) {
     54      throw new Exception('This member is not a member of this community.');
     55    }
     56
     57    if (self::isAdmin($memberId, $communityId)) {
     58      throw new Exception('This member is community admin.');
     59    }
     60
    4961    $communityMember = self::retrieveByMemberIdAndCommunityId($memberId, $communityId);
    5062    $communityMember->delete();
Note: See TracChangeset for help on using the changeset viewer.