Params extends Registry
Tags
Table of Contents
Constants
- CHAT_PARAMS = [self::IS_COPILOT, self::COPILOT_ROLES, self::COPILOT_MAIN_ROLE]
- COPILOT_MAIN_ROLE = 'COPILOT_MAIN_ROLE'
- COPILOT_ROLES = 'COPILOT_ROLES'
- EVENT_CHAT_PARAM_INIT = 'OnChatParamInit'
- IS_COPILOT = 'IS_COPILOT'
Methods
- addParamByArray() : Result
- addParamByName() : Result
- addParamByObject() : Result
- cleanCache() : void
- deleteAll() : Params
- Drops all message params.
- deleteParam() : Params
- filter() : $this
- get() : Param|null
- getAny() : T|null
- getChatId() : int
- getInstance() : Params
- isCreated() : bool
- isValidParamName() : bool
- loadWithoutChat() : self
- merge() : static
- saveWithNewChatId() : Result
- setChatId() : self
- setIsCreated() : void
- toRestFormat() : array<string|int, mixed>
- unsetByKeys() : void
- updateParam() : Result
Constants
CHAT_PARAMS
public
mixed
CHAT_PARAMS
= [self::IS_COPILOT, self::COPILOT_ROLES, self::COPILOT_MAIN_ROLE]
COPILOT_MAIN_ROLE
public
mixed
COPILOT_MAIN_ROLE
= 'COPILOT_MAIN_ROLE'
COPILOT_ROLES
public
mixed
COPILOT_ROLES
= 'COPILOT_ROLES'
EVENT_CHAT_PARAM_INIT
public
mixed
EVENT_CHAT_PARAM_INIT
= 'OnChatParamInit'
IS_COPILOT
public
mixed
IS_COPILOT
= 'IS_COPILOT'
Methods
addParamByArray()
public
addParamByArray(array<string|int, mixed>|null $chatParams) : Result
Parameters
- $chatParams : array<string|int, mixed>|null
Return values
ResultaddParamByName()
public
addParamByName(string $paramName, mixed $paramValue) : Result
Parameters
- $paramName : string
- $paramValue : mixed
Return values
ResultaddParamByObject()
public
addParamByObject(Param $param) : Result
Parameters
- $param : Param
Return values
ResultcleanCache()
public
static cleanCache(int $chatId) : void
Parameters
- $chatId : int
deleteAll()
Drops all message params.
public
deleteAll() : Params
Return values
ParamsdeleteParam()
public
deleteParam(string $paramName) : Params
Parameters
- $paramName : string
Return values
Paramsfilter()
public
filter(callable $predicate) : $this
Parameters
- $predicate : callable
Return values
$thisget()
public
get(string $paramName) : Param|null
Parameters
- $paramName : string
Return values
Param|nullgetAny()
public
getAny() : T|null
Return values
T|nullgetChatId()
public
getChatId() : int
Return values
intgetInstance()
public
static getInstance(int $chatId) : Params
Parameters
- $chatId : int
Return values
ParamsisCreated()
public
isCreated() : bool
Return values
boolisValidParamName()
public
isValidParamName(string $paramName) : bool
Parameters
- $paramName : string
Return values
boolloadWithoutChat()
public
static loadWithoutChat(array<string|int, mixed> $source) : self
Parameters
- $source : array<string|int, mixed>
Return values
selfmerge()
public
merge(Registry<string|int, T> $registry) : static
Parameters
- $registry : Registry<string|int, T>
Return values
staticsaveWithNewChatId()
public
saveWithNewChatId(int $chatId) : Result
Parameters
- $chatId : int
Return values
ResultsetChatId()
public
setChatId(int $chatId) : self
Parameters
- $chatId : int
Return values
selfsetIsCreated()
public
setIsCreated(bool $isCreated) : void
Parameters
- $isCreated : bool
toRestFormat()
public
toRestFormat() : array<string|int, mixed>
Return values
array<string|int, mixed>unsetByKeys()
public
unsetByKeys(array<string|int, mixed> $keys) : void
Parameters
- $keys : array<string|int, mixed>
updateParam()
public
updateParam(string $paramName, mixed $paramValue) : Result
Parameters
- $paramName : string
- $paramValue : mixed