ChatFactory uses ContextCustomer
Table of Contents
Constants
- NON_CACHED_FIELDS = ['MESSAGE_COUNT', 'USER_COUNT', 'LAST_MESSAGE_ID']
Methods
- addChat() : Result
- cleanCache() : void
- createNotifyFeed() : Chat|NotifyChat
- createOpenChat() : Chat|OpenChat
- createOpenLineChat() : Chat|OpenLineChat
- createPersonalChat() : Chat|FavoriteChat
- createPrivateChat() : Chat|PrivateChat
- findChat() : Result
- getChat() : Chat|null
- getChatById() : Chat|null
- getContext() : Context
- Returns the local or global context for the action.
- getEntityChat() : Chat|EntityChat|null
- getGeneralChannel() : ChannelChat|null
- getGeneralChat() : Chat|GeneralChat|null
- getInstance() : self
- Returns current instance of the Dispatcher.
- getNotifyFeed() : Chat|NotifyChat|null
- getPersonalChat() : Chat|FavoriteChat|null
- getPrivateChat() : Chat|PrivateChat|null
- initChat() : Chat
- setContext() : self
- Sets new context for operations.
- setContextUser() : self
- withContext() : static
- Provides local context for the action.
- withContextUser() : static
- Provides local context for the action.
Constants
NON_CACHED_FIELDS
public
mixed
NON_CACHED_FIELDS
= ['MESSAGE_COUNT', 'USER_COUNT', 'LAST_MESSAGE_ID']
Methods
addChat()
public
addChat(array<string|int, mixed> $params) : Result
Parameters
- $params : array<string|int, mixed>
Return values
ResultcleanCache()
public
cleanCache(int $id) : void
Parameters
- $id : int
createNotifyFeed()
public
createNotifyFeed([array<string|int, mixed>|null $params = null ]) : Chat|NotifyChat
Parameters
- $params : array<string|int, mixed>|null = null
Return values
Chat|NotifyChatcreateOpenChat()
public
createOpenChat([array<string|int, mixed>|null $params = null ]) : Chat|OpenChat
Parameters
- $params : array<string|int, mixed>|null = null
Return values
Chat|OpenChatcreateOpenLineChat()
public
createOpenLineChat([array<string|int, mixed>|null $params = null ]) : Chat|OpenLineChat
Parameters
- $params : array<string|int, mixed>|null = null
Return values
Chat|OpenLineChatcreatePersonalChat()
public
createPersonalChat([array<string|int, mixed>|null $params = null ]) : Chat|FavoriteChat
Parameters
- $params : array<string|int, mixed>|null = null
Return values
Chat|FavoriteChatcreatePrivateChat()
public
createPrivateChat([array<string|int, mixed>|null $params = null ]) : Chat|PrivateChat
Parameters
- $params : array<string|int, mixed>|null = null
Return values
Chat|PrivateChatfindChat()
public
findChat(array<string|int, mixed> $params) : Result
Parameters
- $params : array<string|int, mixed>
-
[ (string) MESSAGE_TYPE - Message type: @see \IM_MESSAGE_SYSTEM = S - notification, @see \IM_MESSAGE_PRIVATE = P - private chat, @see \IM_MESSAGE_CHAT = C - group chat, @see \IM_MESSAGE_OPEN = O - open chat, @see \IM_MESSAGE_OPEN_LINE = L - open line chat. (string|int) DIALOG_ID - Dialog Id: chatNNN - chat, sgNNN - sonet group, crmNNN - crm chat, NNN - recipient user. (int) CHAT_ID - Chat Id. (int) TO_USER_ID - Recipient user Id. (int) FROM_USER_ID - Sender user Id. ]
Return values
ResultgetChat()
public
getChat(array<string|int, mixed>|int|string $params) : Chat|null
Parameters
- $params : array<string|int, mixed>|int|string
Return values
Chat|nullgetChatById()
public
getChatById(int $chatId) : Chat|null
Parameters
- $chatId : int
Return values
Chat|nullgetContext()
Returns the local or global context for the action.
public
getContext() : Context
Return values
ContextgetEntityChat()
public
getEntityChat(string $entityType, int|string $entityId) : Chat|EntityChat|null
Parameters
- $entityType : string
- $entityId : int|string
Return values
Chat|EntityChat|nullgetGeneralChannel()
public
getGeneralChannel() : ChannelChat|null
Return values
ChannelChat|nullgetGeneralChat()
public
getGeneralChat() : Chat|GeneralChat|null
Return values
Chat|GeneralChat|nullgetInstance()
Returns current instance of the Dispatcher.
public
static getInstance() : self
Return values
selfgetNotifyFeed()
public
getNotifyFeed([mixed $userId = null ]) : Chat|NotifyChat|null
Parameters
- $userId : mixed = null
Return values
Chat|NotifyChat|nullgetPersonalChat()
public
getPersonalChat([mixed $userId = null ]) : Chat|FavoriteChat|null
Parameters
- $userId : mixed = null
Return values
Chat|FavoriteChat|nullgetPrivateChat()
public
getPrivateChat(mixed $fromUserId, mixed $toUserId) : Chat|PrivateChat|null
Parameters
- $fromUserId : mixed
- $toUserId : mixed
Return values
Chat|PrivateChat|nullinitChat()
public
initChat([array<string|int, mixed>|null $params = null ]) : Chat
Parameters
- $params : array<string|int, mixed>|null = null
Return values
ChatsetContext()
Sets new context for operations.
public
setContext(Context|null $context) : self
Parameters
- $context : Context|null
Return values
selfsetContextUser()
public
setContextUser(mixed $user) : self
Parameters
- $user : mixed
Return values
selfwithContext()
Provides local context for the action.
public
withContext(Context|null $context) : static
Parameters
- $context : Context|null
Return values
staticwithContextUser()
Provides local context for the action.
public
withContextUser(int|User|User $user) : static
Parameters
- $user : int|User|User