class ArrayChannelManager implements ChannelManager

Properties

protected Channel>> $applications

The underlying array of applications and their channels.

Methods

for(Application $application)

Get a scoped channel manager for the given application.

Channel|array|null
channels(string $appId, string|null $channel = null)

Get the channels for an application, optionally filtered by name.

bool
channelExists(string $appId, string $channel)

Determine whether the given channel exists for the application.

Channel|null
findChannel(string $appId, string $channel)

Find the given channel for the application.

findOrCreateChannel(string $appId, string $channelName)

Find the given channel or create it if it doesn't exist.

array
channelConnections(string $appId, string|null $channel = null)

Get all connections for the given channels.

void
unsubscribeFromAllChannels(string $appId, Connection $connection)

Unsubscribe a connection from all channels for the application.

void
removeChannel(string $appId, Channel $channel)

Remove the given channel from the application.

void
flush()

Flush the channel manager repository.

Details

at line 28
ScopedChannelManager for(Application $application)

Get a scoped channel manager for the given application.

Parameters

Application $application

Return Value

ScopedChannelManager

at line 38
Channel|array|null channels(string $appId, string|null $channel = null)

Get the channels for an application, optionally filtered by name.

Parameters

string $appId
string|null $channel

Return Value

Channel|array|null

at line 52
bool channelExists(string $appId, string $channel)

Determine whether the given channel exists for the application.

Parameters

string $appId
string $channel

Return Value

bool

at line 60
Channel|null findChannel(string $appId, string $channel)

Find the given channel for the application.

Parameters

string $appId
string $channel

Return Value

Channel|null

at line 71
Channel findOrCreateChannel(string $appId, string $channelName)

Find the given channel or create it if it doesn't exist.

Note: ChannelCreated event dispatch is handled by Channel::subscribe() via SharedState, not here.

Parameters

string $appId
string $channelName

Return Value

Channel

at line 89
array channelConnections(string $appId, string|null $channel = null)

Get all connections for the given channels.

Parameters

string $appId
string|null $channel

Return Value

array

at line 101
void unsubscribeFromAllChannels(string $appId, Connection $connection)

Unsubscribe a connection from all channels for the application.

Parameters

string $appId
Connection $connection

Return Value

void

at line 114
void removeChannel(string $appId, Channel $channel)

Remove the given channel from the application.

Note: ChannelRemoved event dispatch is handled by Channel::unsubscribe() via SharedState, not here.

Parameters

string $appId
Channel $channel

Return Value

void

at line 122
void flush()

Flush the channel manager repository.

Return Value

void