public function registerRole($itemType, MembershipRole $role) { if (!isset($this->roles[$itemType])) { $this->roles[$itemType] = array(); } $this->roles[$itemType][$role->getId()] = $role; }
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; } }
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()]); }