Chat extends Chat
Table of Contents
Constants
- ERROR_REQUIRED_PARAMETER = 'MAIN_CONTROLLER_22001'
- ERROR_UNKNOWN_ACTION = 'MAIN_CONTROLLER_22002'
- EVENT_ON_AFTER_ACTION = 'onAfterAction'
- EVENT_ON_BEFORE_ACTION = 'onBeforeAction'
- EXCEPTION_UNKNOWN_ACTION = 22002
- SCOPE_AJAX = 'ajax'
- SCOPE_CLI = 'cli'
- SCOPE_REST = 'rest'
Methods
- __construct() : mixed
- Constructor Controller.
- addAction() : array<string|int, mixed>|null
- addManagersAction() : array<string|int, mixed>|null
- addUsersAction() : array<string|int, mixed>|null
- className() : string
- Returns the fully qualified name of this class.
- configureActions() : array<string|int, mixed>
- convertKeysToCamelCase() : array<string|int, mixed>|mixed|string
- Converts keys of array to camel case notation.
- deleteAction() : mixed
- deleteManagersAction() : array<string|int, mixed>|null
- deleteUserAction() : array<string|int, mixed>|null
- extendPullWatchAction() : array<string|int, mixed>|null
- finalizeResponse() : void
- Finalizes response.
- forward() : HttpResponse|mixed
- generateActionMethodName() : string
- getAction() : array<string|int, mixed>|null
- getActionUri() : Uri
- Returns uri for ajax end point for the action name. It's a helper, which uses relative action name without controller name.
- getAutoWiredParameters() : array<string|int, Parameter>
- getConfigurationOfActions() : array<string|int, mixed>|null
- getCurrentUser() : CurrentUser
- getDefaultAutoWiredParameters() : array<string|int, Parameter>
- getErrorByCode() : Error
- Getting once error with the necessary code.
- getErrors() : array<string|int, Error>
- Getting array of errors.
- getFullEventName() : string
- getModuleId() : string
- Returns module id.
- getPrimaryAutoWiredParameter() : Parameter|null
- getRequest() : HttpRequest
- getScope() : string
- getSourceParametersList() : array<string|int, mixed>
- getUnsignedParameters() : mixed
- isLocatedUnderPsr4() : bool
- joinAction() : array<string|int, mixed>|null
- listNameActions() : array<string|int, mixed>
- Returns list of all
- listSharedAction() : array<string|int, mixed>|null
- loadAction() : array<string|int, mixed>|null
- loadInContextAction() : array<string|int, mixed>|null
- pinAction() : array<string|int, mixed>|null
- readAction() : array<string|int, mixed>|null
- readAllAction() : array<string|int, mixed>|null
- recursiveWhiteList() : mixed
- redirectTo() : Redirect
- Redirect to URL.
- run() : HttpResponse|mixed
- setAvatarAction() : mixed
- setAvatarIdAction() : mixed
- setColorAction() : mixed
- setCurrentUser() : void
- setDescriptionAction() : mixed
- setDisappearingDurationAction() : mixed
- setManageMessagesAction() : mixed
- setManagersAction() : mixed
- setManageSettingsAction() : mixed
- setManageUIAction() : mixed
- setManageUsersAddAction() : mixed
- setManageUsersDeleteAction() : mixed
- setOwnerAction() : mixed
- setScope() : Controller
- setSourceParametersList() : Controller
- setTitleAction() : mixed
- shallowLoadAction() : array<string|int, mixed>|null
- sortPinAction() : array<string|int, mixed>|null
- startRecordVoiceAction() : array<string|int, mixed>|null
- unpinAction() : array<string|int, mixed>|null
- unreadAction() : array<string|int, mixed>|null
- updateAction() : mixed
- updateAvatarAction() : mixed
Constants
ERROR_REQUIRED_PARAMETER
public
mixed
ERROR_REQUIRED_PARAMETER
= 'MAIN_CONTROLLER_22001'
ERROR_UNKNOWN_ACTION
public
mixed
ERROR_UNKNOWN_ACTION
= 'MAIN_CONTROLLER_22002'
EVENT_ON_AFTER_ACTION
public
mixed
EVENT_ON_AFTER_ACTION
= 'onAfterAction'
EVENT_ON_BEFORE_ACTION
public
mixed
EVENT_ON_BEFORE_ACTION
= 'onBeforeAction'
EXCEPTION_UNKNOWN_ACTION
public
mixed
EXCEPTION_UNKNOWN_ACTION
= 22002
SCOPE_AJAX
public
mixed
SCOPE_AJAX
= 'ajax'
SCOPE_CLI
public
mixed
SCOPE_CLI
= 'cli'
SCOPE_REST
public
mixed
SCOPE_REST
= 'rest'
Methods
__construct()
Constructor Controller.
public
__construct([Request|null $request = null ]) : mixed
Parameters
- $request : Request|null = null
addAction()
public
addAction(array<string|int, mixed> $fields) : array<string|int, mixed>|null
Parameters
- $fields : array<string|int, mixed>
Tags
Return values
array<string|int, mixed>|nulladdManagersAction()
public
addManagersAction(GroupChat $chat, array<string|int, mixed> $userIds) : array<string|int, mixed>|null
Parameters
- $chat : GroupChat
- $userIds : array<string|int, mixed>
Tags
Return values
array<string|int, mixed>|nulladdUsersAction()
public
addUsersAction(Chat $chat, array<string|int, mixed> $userIds[, string|null $hideHistory = null ]) : array<string|int, mixed>|null
Parameters
- $chat : Chat
- $userIds : array<string|int, mixed>
- $hideHistory : string|null = null
Tags
Return values
array<string|int, mixed>|nullclassName()
Returns the fully qualified name of this class.
public
final static className() : string
Return values
stringconfigureActions()
public
configureActions() : array<string|int, mixed>
Return values
array<string|int, mixed>convertKeysToCamelCase()
Converts keys of array to camel case notation.
public
convertKeysToCamelCase(mixed $data) : array<string|int, mixed>|mixed|string
Parameters
- $data : mixed
-
Data.
Tags
Return values
array<string|int, mixed>|mixed|stringdeleteAction()
public
deleteAction(Chat $chat) : mixed
Parameters
- $chat : Chat
Tags
deleteManagersAction()
public
deleteManagersAction(GroupChat $chat, array<string|int, mixed> $userIds) : array<string|int, mixed>|null
Parameters
- $chat : GroupChat
- $userIds : array<string|int, mixed>
Tags
Return values
array<string|int, mixed>|nulldeleteUserAction()
public
deleteUserAction(Chat $chat, int $userId) : array<string|int, mixed>|null
Parameters
- $chat : Chat
- $userId : int
Tags
Return values
array<string|int, mixed>|nullextendPullWatchAction()
public
extendPullWatchAction(Chat $chat) : array<string|int, mixed>|null
Parameters
- $chat : Chat
Tags
Return values
array<string|int, mixed>|nullfinalizeResponse()
Finalizes response.
public
finalizeResponse(Response $response) : void
The method will be invoked when HttpApplication will be ready to send response to client. It's a final place where Controller can interact with response.
Parameters
- $response : Response
forward()
public
forward(Controller|string $controller, string $actionName[, array<string|int, mixed>|null $parameters = null ]) : HttpResponse|mixed
Parameters
- $controller : Controller|string
- $actionName : string
- $parameters : array<string|int, mixed>|null = null
Tags
Return values
HttpResponse|mixedgenerateActionMethodName()
public
final generateActionMethodName(mixed $action) : string
Parameters
- $action : mixed
Return values
stringgetAction()
public
getAction(Chat $chat) : array<string|int, mixed>|null
Parameters
- $chat : Chat
Tags
Return values
array<string|int, mixed>|nullgetActionUri()
Returns uri for ajax end point for the action name. It's a helper, which uses relative action name without controller name.
public
final getActionUri(string $actionName[, array<string|int, mixed> $params = [] ][, bool $absolute = false ]) : Uri
Parameters
- $actionName : string
-
Action name. It's a relative action name without controller name.
- $params : array<string|int, mixed> = []
-
Parameters for creating uri.
- $absolute : bool = false
Return values
UrigetAutoWiredParameters()
public
getAutoWiredParameters() : array<string|int, Parameter>
Return values
array<string|int, Parameter>getConfigurationOfActions()
public
final getConfigurationOfActions() : array<string|int, mixed>|null
Return values
array<string|int, mixed>|nullgetCurrentUser()
public
final getCurrentUser() : CurrentUser
Return values
CurrentUsergetDefaultAutoWiredParameters()
public
final getDefaultAutoWiredParameters() : array<string|int, Parameter>
Return values
array<string|int, Parameter>getErrorByCode()
Getting once error with the necessary code.
public
final getErrorByCode(string $code) : Error
Parameters
- $code : string
-
Code of error.
Return values
ErrorgetErrors()
Getting array of errors.
public
final getErrors() : array<string|int, Error>
Return values
array<string|int, Error>getFullEventName()
public
final static getFullEventName(mixed $eventName) : string
Parameters
- $eventName : mixed
Return values
stringgetModuleId()
Returns module id.
public
final getModuleId() : string
Tries to guess module id by file path and function @see getModuleId().
Return values
stringgetPrimaryAutoWiredParameter()
public
getPrimaryAutoWiredParameter() : Parameter|null
Return values
Parameter|nullgetRequest()
public
final getRequest() : HttpRequest
Return values
HttpRequestgetScope()
public
final getScope() : string
Return values
stringgetSourceParametersList()
public
final getSourceParametersList() : array<string|int, mixed>
Return values
array<string|int, mixed>getUnsignedParameters()
public
final getUnsignedParameters() : mixed
isLocatedUnderPsr4()
public
final isLocatedUnderPsr4() : bool
Return values
booljoinAction()
public
joinAction(Chat $chat) : array<string|int, mixed>|null
Parameters
- $chat : Chat
Tags
Return values
array<string|int, mixed>|nulllistNameActions()
Returns list of all
public
final listNameActions() : array<string|int, mixed>
Return values
array<string|int, mixed>listSharedAction()
public
listSharedAction(array<string|int, mixed> $filter[, int $limit = self::DEFAULT_LIMIT ][, int $offset = 0 ]) : array<string|int, mixed>|null
Parameters
- $filter : array<string|int, mixed>
- $limit : int = self::DEFAULT_LIMIT
- $offset : int = 0
Tags
Return values
array<string|int, mixed>|nullloadAction()
public
loadAction(Chat $chat[, int $messageLimit = ChatMessage::DEFAULT_LIMIT ][, int $pinLimit = Pin::DEFAULT_LIMIT ][, string $ignoreMark = 'N' ]) : array<string|int, mixed>|null
Parameters
- $chat : Chat
- $messageLimit : int = ChatMessage::DEFAULT_LIMIT
- $pinLimit : int = Pin::DEFAULT_LIMIT
- $ignoreMark : string = 'N'
Tags
Return values
array<string|int, mixed>|nullloadInContextAction()
public
loadInContextAction(Message $message[, int $messageLimit = ChatMessage::DEFAULT_LIMIT ][, int $pinLimit = Pin::DEFAULT_LIMIT ]) : array<string|int, mixed>|null
Parameters
- $message : Message
- $messageLimit : int = ChatMessage::DEFAULT_LIMIT
- $pinLimit : int = Pin::DEFAULT_LIMIT
Tags
Return values
array<string|int, mixed>|nullpinAction()
public
pinAction(Chat $chat, CurrentUser $user) : array<string|int, mixed>|null
Parameters
- $chat : Chat
- $user : CurrentUser
Tags
Return values
array<string|int, mixed>|nullreadAction()
public
readAction(Chat $chat[, string $onlyRecent = 'N' ]) : array<string|int, mixed>|null
Parameters
- $chat : Chat
- $onlyRecent : string = 'N'
Tags
Return values
array<string|int, mixed>|nullreadAllAction()
public
readAllAction(CurrentUser $user) : array<string|int, mixed>|null
Parameters
- $user : CurrentUser
Tags
Return values
array<string|int, mixed>|nullrecursiveWhiteList()
public
static recursiveWhiteList(mixed $fields, mixed $whiteList[, bool $sanitizeOnly = false ]) : mixed
Parameters
- $fields : mixed
- $whiteList : mixed
- $sanitizeOnly : bool = false
redirectTo()
Redirect to URL.
public
redirectTo(string $url) : Redirect
Parameters
- $url : string
Return values
Redirectrun()
public
final run(mixed $actionName, array<string|int, mixed> $sourceParametersList) : HttpResponse|mixed
Parameters
- $actionName : mixed
- $sourceParametersList : array<string|int, mixed>
Tags
Return values
HttpResponse|mixedsetAvatarAction()
public
setAvatarAction(Chat $chat, string $avatarBase64) : mixed
Parameters
- $chat : Chat
- $avatarBase64 : string
Tags
setAvatarIdAction()
public
setAvatarIdAction(Chat $chat, int $avatarId) : mixed
Parameters
- $chat : Chat
- $avatarId : int
Tags
setColorAction()
public
setColorAction(Chat $chat, string $color) : mixed
Parameters
- $chat : Chat
- $color : string
Tags
setCurrentUser()
public
final setCurrentUser(CurrentUser $currentUser) : void
Parameters
- $currentUser : CurrentUser
setDescriptionAction()
public
setDescriptionAction(Chat $chat, string $description) : mixed
Parameters
- $chat : Chat
- $description : string
Tags
setDisappearingDurationAction()
public
setDisappearingDurationAction(Chat $chat, int $hours) : mixed
Parameters
- $chat : Chat
- $hours : int
Tags
setManageMessagesAction()
public
setManageMessagesAction(Chat $chat, string $rightsLevel) : mixed
Parameters
- $chat : Chat
- $rightsLevel : string
Tags
setManagersAction()
public
setManagersAction(Chat $chat, array<string|int, mixed> $userIds) : mixed
Parameters
- $chat : Chat
- $userIds : array<string|int, mixed>
Tags
setManageSettingsAction()
public
setManageSettingsAction(Chat $chat, string $rightsLevel) : mixed
Parameters
- $chat : Chat
- $rightsLevel : string
Tags
setManageUIAction()
public
setManageUIAction(Chat $chat, string $rightsLevel) : mixed
Parameters
- $chat : Chat
- $rightsLevel : string
Tags
setManageUsersAddAction()
public
setManageUsersAddAction(Chat $chat, string $rightsLevel) : mixed
Parameters
- $chat : Chat
- $rightsLevel : string
Tags
setManageUsersDeleteAction()
public
setManageUsersDeleteAction(Chat $chat, string $rightsLevel) : mixed
Parameters
- $chat : Chat
- $rightsLevel : string
Tags
setOwnerAction()
public
setOwnerAction(Chat $chat, int $ownerId) : mixed
Parameters
- $chat : Chat
- $ownerId : int
Tags
setScope()
public
final setScope(string $scope) : Controller
Parameters
- $scope : string
Return values
ControllersetSourceParametersList()
public
final setSourceParametersList(array<string|int, mixed> $sourceParametersList) : Controller
Parameters
- $sourceParametersList : array<string|int, mixed>
Return values
ControllersetTitleAction()
public
setTitleAction(Chat $chat, string $title) : mixed
Parameters
- $chat : Chat
- $title : string
Tags
shallowLoadAction()
public
shallowLoadAction(Chat $chat) : array<string|int, mixed>|null
Parameters
- $chat : Chat
Tags
Return values
array<string|int, mixed>|nullsortPinAction()
public
sortPinAction(Chat $chat, int $newPosition, CurrentUser $user) : array<string|int, mixed>|null
Parameters
- $chat : Chat
- $newPosition : int
- $user : CurrentUser
Tags
Return values
array<string|int, mixed>|nullstartRecordVoiceAction()
public
startRecordVoiceAction(Chat $chat) : array<string|int, mixed>|null
Parameters
- $chat : Chat
Tags
Return values
array<string|int, mixed>|nullunpinAction()
public
unpinAction(Chat $chat, CurrentUser $user) : array<string|int, mixed>|null
Parameters
- $chat : Chat
- $user : CurrentUser
Tags
Return values
array<string|int, mixed>|nullunreadAction()
public
unreadAction(Chat $chat) : array<string|int, mixed>|null
Parameters
- $chat : Chat
Tags
Return values
array<string|int, mixed>|nullupdateAction()
public
updateAction(GroupChat $chat, array<string|int, mixed> $fields) : mixed
Parameters
- $chat : GroupChat
- $fields : array<string|int, mixed>
Tags
updateAvatarAction()
public
updateAvatarAction(Chat $chat, string $avatar) : mixed
Parameters
- $chat : Chat
- $avatar : string