コード例 #1
0
ファイル: Rooms.php プロジェクト: polidog/php-chatwork-api
 /**
  * グループチャットを新規作成
  * @param Room $room
  * @param MembersCollection $members
  * @return Room
  */
 public function create(Room $room, MembersCollection $members)
 {
     $result = $this->client->post('rooms', ['body' => ['name' => $room->name, 'description' => $room->description, 'members_admin_ids' => implode(',', $members->getAdminIds()), 'members_member_ids' => implode(',', $members->getMemberIds()), 'members_readonly_ids' => implode(',', $members->getReadonlyIds())]])->json();
     $room->roomId = $result['room_id'];
     return $room;
 }
コード例 #2
0
ファイル: Members.php プロジェクト: polidog/php-chatwork-api
 /**
  * @param MembersCollection $members
  */
 public function update(MembersCollection $members)
 {
     $options = ['body' => ['members_admin_ids' => implode(',', $members->getAdminIds()), 'members_member_ids' => implode(',', $members->getMemberIds()), 'members_readonly_ids' => implode(',', $members->getReadonlyIds())]];
     $this->client->put(['rooms/{roomId}/members', ['roomId' => $this->roomId]], $options);
 }