예제 #1
0
 public function registerRole($itemType, MembershipRole $role)
 {
     if (!isset($this->roles[$itemType])) {
         $this->roles[$itemType] = array();
     }
     $this->roles[$itemType][$role->getId()] = $role;
 }
예제 #2
0
 public function editMember(MembershipEntityInterface $item, User $user, MembershipRole $role, $note)
 {
     if ($role->isUnknown()) {
         return ['status' => 0];
     }
     $this->transaction->requestTransaction();
     try {
         if ($item->editMember($this->conn, $user, $role, $note)) {
             return ['status' => 1, 'data' => $item->findMembers($this->conn, $this->roleResolver)];
         }
         return ['status' => 0, 'data' => $item->findMembers($this->conn, $this->roleResolver)];
     } catch (Exception $exception) {
         $this->transaction->requestRollback();
         throw $exception;
     }
 }
예제 #3
0
파일: Area.php 프로젝트: zyxist/cantiga
 public function editMember(Connection $conn, User $user, MembershipRole $role, $note)
 {
     return 1 == $conn->update(CoreTables::AREA_MEMBER_TBL, ['role' => (int) $role->getId(), 'note' => $note], ['areaId' => $this->getId(), 'userId' => $user->getId()]);
 }