Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 11 additions & 44 deletions lib/GetStream/StreamChat/ChannelBatchUpdater.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public function __construct(Client $client)

/**
* Adds members to channels matching the filter.
* @param array $filter Filter to match channels (keys: cids, types, filter_tags)
* @param array $filter Filter to match channels (keys: cids, types)
* @param array $members Array of member arrays, each with user_id (required) and optional channel_role
* @return StreamResponse
* @throws StreamException
Expand All @@ -38,7 +38,7 @@ public function addMembers(array $filter, array $members): StreamResponse

/**
* Removes members from channels matching the filter.
* @param array $filter Filter to match channels (keys: cids, types, filter_tags)
* @param array $filter Filter to match channels (keys: cids, types)
* @param array $members Array of member arrays, each with user_id (required) and optional channel_role
* @return StreamResponse
* @throws StreamException
Expand All @@ -55,7 +55,7 @@ public function removeMembers(array $filter, array $members): StreamResponse

/**
* Invites members to channels matching the filter.
* @param array $filter Filter to match channels (keys: cids, types, filter_tags)
* @param array $filter Filter to match channels (keys: cids, types)
* @param array $members Array of member arrays, each with user_id (required) and optional channel_role
* @return StreamResponse
* @throws StreamException
Expand All @@ -72,7 +72,7 @@ public function inviteMembers(array $filter, array $members): StreamResponse

/**
* Assigns roles to members in channels matching the filter.
* @param array $filter Filter to match channels (keys: cids, types, filter_tags)
* @param array $filter Filter to match channels (keys: cids, types)
* @param array $members Array of member arrays, each with user_id (required) and optional channel_role
* @return StreamResponse
* @throws StreamException
Expand All @@ -89,7 +89,7 @@ public function assignRoles(array $filter, array $members): StreamResponse

/**
* Adds moderators to channels matching the filter.
* @param array $filter Filter to match channels (keys: cids, types, filter_tags)
* @param array $filter Filter to match channels (keys: cids, types)
* @param array $members Array of member arrays, each with user_id (required) and optional channel_role
* @return StreamResponse
* @throws StreamException
Expand All @@ -106,7 +106,7 @@ public function addModerators(array $filter, array $members): StreamResponse

/**
* Removes moderator role from members in channels matching the filter.
* @param array $filter Filter to match channels (keys: cids, types, filter_tags)
* @param array $filter Filter to match channels (keys: cids, types)
* @param array $members Array of member arrays, each with user_id (required) and optional channel_role
* @return StreamResponse
* @throws StreamException
Expand All @@ -123,7 +123,7 @@ public function demoteModerators(array $filter, array $members): StreamResponse

/**
* Hides channels matching the filter for the specified members.
* @param array $filter Filter to match channels (keys: cids, types, filter_tags)
* @param array $filter Filter to match channels (keys: cids, types)
* @param array $members Array of member arrays, each with user_id (required) and optional channel_role
* @return StreamResponse
* @throws StreamException
Expand All @@ -140,7 +140,7 @@ public function hide(array $filter, array $members): StreamResponse

/**
* Shows channels matching the filter for the specified members.
* @param array $filter Filter to match channels (keys: cids, types, filter_tags)
* @param array $filter Filter to match channels (keys: cids, types)
* @param array $members Array of member arrays, each with user_id (required) and optional channel_role
* @return StreamResponse
* @throws StreamException
Expand All @@ -157,7 +157,7 @@ public function show(array $filter, array $members): StreamResponse

/**
* Archives channels matching the filter for the specified members.
* @param array $filter Filter to match channels (keys: cids, types, filter_tags)
* @param array $filter Filter to match channels (keys: cids, types)
* @param array $members Array of member arrays, each with user_id (required) and optional channel_role
* @return StreamResponse
* @throws StreamException
Expand All @@ -174,7 +174,7 @@ public function archive(array $filter, array $members): StreamResponse

/**
* Unarchives channels matching the filter for the specified members.
* @param array $filter Filter to match channels (keys: cids, types, filter_tags)
* @param array $filter Filter to match channels (keys: cids, types)
* @param array $members Array of member arrays, each with user_id (required) and optional channel_role
* @return StreamResponse
* @throws StreamException
Expand All @@ -191,7 +191,7 @@ public function unarchive(array $filter, array $members): StreamResponse

/**
* Updates data on channels matching the filter.
* @param array $filter Filter to match channels (keys: cids, types, filter_tags)
* @param array $filter Filter to match channels (keys: cids, types)
* @param array $data Data to update (keys: frozen, disabled, custom, team, config_overrides, auto_translation_enabled, auto_translation_language)
* @return StreamResponse
* @throws StreamException
Expand All @@ -206,37 +206,4 @@ public function updateData(array $filter, array $data): StreamResponse
return $this->client->updateChannelsBatch($options);
}

/**
* Adds filter tags to channels matching the filter.
* @param array $filter Filter to match channels (keys: cids, types, filter_tags)
* @param array $tags Array of filter tag strings
* @return StreamResponse
* @throws StreamException
*/
public function addFilterTags(array $filter, array $tags): StreamResponse
{
$options = [
"operation" => "addFilterTags",
"filter" => $filter,
"filter_tags_update" => $tags,
];
return $this->client->updateChannelsBatch($options);
}

/**
* Removes filter tags from channels matching the filter.
* @param array $filter Filter to match channels (keys: cids, types, filter_tags)
* @param array $tags Array of filter tag strings
* @return StreamResponse
* @throws StreamException
*/
public function removeFilterTags(array $filter, array $tags): StreamResponse
{
$options = [
"operation" => "removeFilterTags",
"filter" => $filter,
"filter_tags_update" => $tags,
];
return $this->client->updateChannelsBatch($options);
}
}