Message implements ArrayAccess, RegistryEntry, ActiveRecord, RestEntity, PopupDataAggregatable, DateFilterable uses FieldAccessImplementation, ActiveRecordImplementation, RegistryEntryImplementation, ContextCustomer
Chat version #2
Table of Contents
Interfaces
- ArrayAccess
- RegistryEntry
- ActiveRecord
- RestEntity
- PopupDataAggregatable
- An interface for classes that have entities within them that should be taken to the top level of a REST response.
- DateFilterable
Constants
- MESSAGE_MAX_LENGTH = 20000
- REST_FIELDS = ['ID', 'CHAT_ID', 'AUTHOR_ID', 'DATE_CREATE', 'MESSAGE', 'NOTIFY_EVENT', 'NOTIFY_READ']
Methods
- __construct() : mixed
- addFile() : self
- addToReminder() : Result
- allowNotifyAnswer() : bool|null
- autocompleteParams() : self
- checkAccess() : Result
- checkEmoji() : self
- Parse dates from message.
- delete() : Result
- deleteComplete() : Result
- deleteHard() : Result
- deleteSoft() : Result
- fill() : static
- Fills object's fields with provided values.
- fillActual() : self
- fillFiles() : self
- fillMessageOut() : string|null
- filterByDate() : FilterResult<string|int, static|null>
- filterMessageText() : void
- generateUrlPreview() : void
- Appends message with an url preview attachment.
- getAdditionalMessageIds() : array<string|int, mixed>
- getAttach() : AttachArray|MessageParameter
- getAuthor() : User|null
- getAuthorId() : int
- getChat() : Chat
- getChatId() : int|null
- getContext() : Context
- Returns the local or global context for the action.
- getContextId() : string
- getCopilotData() : array<string|int, mixed>|null
- getDataClass() : string
- Returns ORM tablet class name.
- getDataEntity() : EntityObject
- getDateCreate() : DateTime|null
- getDefaultDateCreate() : DateTime
- getDefaultNotifyEvent() : string|null
- getDefaultNotifyModule() : string|null
- getDefaultNotifyRead() : bool
- getDefaultNotifyType() : int
- getDisappearingTime() : DateTime|null
- getEmailTemplate() : string|null
- getEnrichedParams() : Params
- getFileIds() : array<string|int, int>
- getFiles() : FileCollection
- getFilesDiskData() : array<string|int, mixed>
- getFileUuid() : string|null
- getFormattedMessage() : string
- getForPush() : string
- getForwardInfo() : array<string|int, mixed>|null
- getForwardUuid() : string|null
- getId() : int|null
- Returns the id of the entity
- getImportantFor() : array<string|int, mixed>
- getImportId() : int|null
- getKeyboard() : Keyboard|MessageParameter
- getMenu() : Menu|MessageParameter
- getMessage() : string|null
- getMessageId() : int|null
- getMessageOut() : string|null
- getNotifyButtons() : array<string|int, mixed>|null
- getNotifyEvent() : string|null
- Returns source module event id.
- getNotifyLink() : string|null
- getNotifyModule() : string|null
- getNotifySubTag() : string|null
- getNotifyTag() : string|null
- getNotifyTitle() : string|null
- getNotifyType() : int
- getParams() : Params
- getParsedMessage() : string
- getPopupData() : PopupData
- Returns the data to be raised to the top of the REST response. Works on the principle of the composite pattern.
- getPrevId() : int
- getPreviewMessage() : string
- getPrimaryId() : int|null
- getPushAppId() : string|null
- getPushMessage() : string|null
- getPushParams() : array<string|int, mixed>|null
- getQuotedMessage() : string
- getReactions() : ReactionMessage
- getRegistry() : Registry|null
- Return link of the object's registry.
- getRelatedChatId() : int|null
- getReminder() : ReminderItem|null
- getReplaceMap() : array<string|int, mixed>
- getRestEntityName() : string
- Returns the name of the entity that will be used in the rest response
- getUrl() : UrlItem|null
- getUserIds() : array<string|int, mixed>
- getUserIdsFromMention() : array<string|int, mixed>
- getUserIdsToSendMentions() : array<string|int, mixed>
- getUuid() : string|null
- hasFiles() : bool
- isChanged() : bool
- Tells true if object has been changed.
- isCompletelyEmpty() : bool
- isDeleted() : bool
- Tells true if object marked to drop.
- isDisappearing() : bool
- isForward() : bool
- isImportant() : bool|null
- isNotifyFlash() : bool|null
- isNotifyRead() : bool|null
- isSystem() : bool
- isUnread() : bool
- isViewed() : bool
- isViewedByOthers() : bool
- load() : Result
- loadPhrases() : void
- Lazy load message's context phrases.
- mark() : Result
- markAsFavorite() : Result
- markAsImportant() : self
- markAsSystem() : self
- markChanged() : static
- Marks object changed.
- markDrop() : static
- Marks object to drop on save.
- markNotifyAnswer() : self
- markNotifyFlash() : self
- markNotifyRead() : self
- offsetExists() : bool
- offsetGet() : mixed
- offsetSet() : void
- offsetUnset() : void
- onAfterOrmUpdate() : self
- parseDates() : self
- Parse dates from message.
- pin() : Result
- prepareFields() : Result
- processChangeAuthorId() : int
- processChangeNotifyEvent() : string|null
- resetParams() : $this
- save() : Result
- Saves object state into database.
- setAttach() : $this
- setAuthorId() : self
- setBotId() : self
- setChat() : self
- setChatId() : self
- setContext() : self
- Sets new context for operations.
- setContextUser() : self
- setDateCreate() : static
- setEmailTemplate() : self
- setFiles() : static
- setFileUuid() : self
- setForwardUuid() : self
- setImportantFor() : self
- setImportId() : self
- setKeyboard() : $this
- setMenu() : self
- setMessage() : self
- setMessageId() : self
- setMessageOut() : self
- setNotifyButtons() : self
- setNotifyEvent() : string|null
- Sets source module event id.
- setNotifyLink() : self
- setNotifyModule() : self
- setNotifySubTag() : self
- setNotifyTag() : self
- setNotifyTitle() : self
- setNotifyType() : self
- setParams() : $this
- setPrimaryId() : self
- setPushAppId() : self
- setPushMessage() : self
- setPushParams() : self
- setReactions() : $this
- setRegistry() : self
- setUnread() : self
- setUrl() : self
- setUuid() : self
- setViewed() : self
- toArray() : array<string|int, mixed>
- Returns object state as array.
- toRestFormat() : array<string|int, mixed>
- Returns an array in JSON like format to return the entity as a rest response.
- unmarkAsFavorite() : Result
- unpin() : Result
- updateSearchIndex() : void
- Update search index record.
- uploadFileFromText() : array<string|int, mixed>
- Extracts and saves files from message text.
- withContext() : static
- Provides local context for the action.
- withContextUser() : static
- Provides local context for the action.
Constants
MESSAGE_MAX_LENGTH
public
mixed
MESSAGE_MAX_LENGTH
= 20000
REST_FIELDS
public
mixed
REST_FIELDS
= ['ID', 'CHAT_ID', 'AUTHOR_ID', 'DATE_CREATE', 'MESSAGE', 'NOTIFY_EVENT', 'NOTIFY_READ']
Methods
__construct()
public
__construct([int|array<string|int, mixed>|EO_Message|null $source = null ]) : mixed
Parameters
- $source : int|array<string|int, mixed>|EO_Message|null = null
addFile()
public
addFile(FileItem $file) : self
Parameters
- $file : FileItem
Return values
selfaddToReminder()
public
addToReminder(DateTime $dateRemind) : Result
Parameters
- $dateRemind : DateTime
Return values
ResultallowNotifyAnswer()
public
allowNotifyAnswer() : bool|null
Return values
bool|nullautocompleteParams()
public
autocompleteParams(SendingConfig $config) : self
Parameters
- $config : SendingConfig
Return values
selfcheckAccess()
public
checkAccess([int|null $userId = null ]) : Result
Parameters
- $userId : int|null = null
Return values
ResultcheckEmoji()
Parse dates from message.
public
checkEmoji() : self
Return values
selfdelete()
public
delete() : Result
Return values
ResultdeleteComplete()
public
deleteComplete() : Result
Return values
ResultdeleteHard()
public
deleteHard() : Result
Return values
ResultdeleteSoft()
public
deleteSoft() : Result
Return values
Resultfill()
Fills object's fields with provided values.
public
fill(array<string|int, mixed> $source) : static
Parameters
- $source : array<string|int, mixed>
Return values
staticfillActual()
public
fillActual(array<string|int, mixed> $fieldsToFill) : self
Parameters
- $fieldsToFill : array<string|int, mixed>
Return values
selffillFiles()
public
fillFiles(FileCollection $files) : self
Parameters
- $files : FileCollection
Return values
selffillMessageOut()
public
fillMessageOut() : string|null
Return values
string|nullfilterByDate()
public
filterByDate(DateTime $date) : FilterResult<string|int, static|null>
Parameters
- $date : DateTime
Return values
FilterResult<string|int, static|null>filterMessageText()
public
filterMessageText() : void
generateUrlPreview()
Appends message with an url preview attachment.
public
generateUrlPreview() : void
getAdditionalMessageIds()
public
getAdditionalMessageIds() : array<string|int, mixed>
Return values
array<string|int, mixed>getAttach()
public
getAttach() : AttachArray|MessageParameter
Return values
AttachArray|MessageParametergetAuthor()
public
getAuthor() : User|null
Return values
User|nullgetAuthorId()
public
getAuthorId() : int
Return values
intgetChat()
public
getChat() : Chat
Return values
ChatgetChatId()
public
getChatId() : int|null
Return values
int|nullgetContext()
Returns the local or global context for the action.
public
getContext() : Context
Return values
ContextgetContextId()
public
getContextId() : string
Return values
stringgetCopilotData()
public
getCopilotData() : array<string|int, mixed>|null
Return values
array<string|int, mixed>|nullgetDataClass()
Returns ORM tablet class name.
public
static getDataClass() : string
Tags
Return values
stringgetDataEntity()
public
getDataEntity() : EntityObject
Return values
EntityObjectgetDateCreate()
public
getDateCreate() : DateTime|null
Return values
DateTime|nullgetDefaultDateCreate()
public
getDefaultDateCreate() : DateTime
Return values
DateTimegetDefaultNotifyEvent()
public
getDefaultNotifyEvent() : string|null
Return values
string|nullgetDefaultNotifyModule()
public
getDefaultNotifyModule() : string|null
Return values
string|nullgetDefaultNotifyRead()
public
getDefaultNotifyRead() : bool
Return values
boolgetDefaultNotifyType()
public
getDefaultNotifyType() : int
Return values
intgetDisappearingTime()
public
getDisappearingTime() : DateTime|null
Return values
DateTime|nullgetEmailTemplate()
public
getEmailTemplate() : string|null
Return values
string|nullgetEnrichedParams()
public
getEnrichedParams([bool $withUrl = true ]) : Params
Parameters
- $withUrl : bool = true
Return values
ParamsgetFileIds()
public
getFileIds() : array<string|int, int>
Return values
array<string|int, int>getFiles()
public
getFiles() : FileCollection
Return values
FileCollectiongetFilesDiskData()
public
getFilesDiskData() : array<string|int, mixed>
Return values
array<string|int, mixed>getFileUuid()
public
getFileUuid() : string|null
Return values
string|nullgetFormattedMessage()
public
getFormattedMessage() : string
Return values
stringgetForPush()
public
getForPush([int|null $messageSize = 200 ]) : string
Parameters
- $messageSize : int|null = 200
Return values
stringgetForwardInfo()
public
getForwardInfo() : array<string|int, mixed>|null
Return values
array<string|int, mixed>|nullgetForwardUuid()
public
getForwardUuid() : string|null
Return values
string|nullgetId()
Returns the id of the entity
public
getId() : int|null
Return values
int|nullgetImportantFor()
public
getImportantFor() : array<string|int, mixed>
Return values
array<string|int, mixed>getImportId()
public
getImportId() : int|null
Return values
int|nullgetKeyboard()
public
getKeyboard() : Keyboard|MessageParameter
Return values
Keyboard|MessageParametergetMenu()
public
getMenu() : Menu|MessageParameter
Return values
Menu|MessageParametergetMessage()
public
getMessage() : string|null
Return values
string|nullgetMessageId()
public
getMessageId() : int|null
Return values
int|nullgetMessageOut()
public
getMessageOut() : string|null
Return values
string|nullgetNotifyButtons()
public
getNotifyButtons() : array<string|int, mixed>|null
Return values
array<string|int, mixed>|nullgetNotifyEvent()
Returns source module event id.
public
getNotifyEvent() : string|null
Tags
Return values
string|nullgetNotifyLink()
public
getNotifyLink() : string|null
Return values
string|nullgetNotifyModule()
public
getNotifyModule() : string|null
Return values
string|nullgetNotifySubTag()
public
getNotifySubTag() : string|null
Return values
string|nullgetNotifyTag()
public
getNotifyTag() : string|null
Return values
string|nullgetNotifyTitle()
public
getNotifyTitle() : string|null
Return values
string|nullgetNotifyType()
public
getNotifyType() : int
Return values
intgetParams()
public
getParams([bool $disallowLazyLoad = false ]) : Params
Parameters
- $disallowLazyLoad : bool = false
Return values
ParamsgetParsedMessage()
public
getParsedMessage() : string
Return values
stringgetPopupData()
Returns the data to be raised to the top of the REST response. Works on the principle of the composite pattern.
public
getPopupData([array<string|int, mixed> $excludedList = [] ]) : PopupData
Parameters
- $excludedList : array<string|int, mixed> = []
Return values
PopupDatagetPrevId()
public
getPrevId() : int
Return values
intgetPreviewMessage()
public
getPreviewMessage([int|null $messageSize = 200 ]) : string
Parameters
- $messageSize : int|null = 200
Return values
stringgetPrimaryId()
public
getPrimaryId() : int|null
Return values
int|nullgetPushAppId()
public
getPushAppId() : string|null
Return values
string|nullgetPushMessage()
public
getPushMessage() : string|null
Return values
string|nullgetPushParams()
public
getPushParams() : array<string|int, mixed>|null
Return values
array<string|int, mixed>|nullgetQuotedMessage()
public
getQuotedMessage([int|null $messageSize = null ]) : string
Parameters
- $messageSize : int|null = null
Return values
stringgetReactions()
public
getReactions() : ReactionMessage
Return values
ReactionMessagegetRegistry()
Return link of the object's registry.
public
getRegistry() : Registry|null
Return values
Registry|nullgetRelatedChatId()
public
getRelatedChatId() : int|null
Return values
int|nullgetReminder()
public
getReminder() : ReminderItem|null
Return values
ReminderItem|nullgetReplaceMap()
public
getReplaceMap() : array<string|int, mixed>
Return values
array<string|int, mixed>getRestEntityName()
Returns the name of the entity that will be used in the rest response
public
static getRestEntityName() : string
Return values
stringgetUrl()
public
getUrl() : UrlItem|null
Return values
UrlItem|nullgetUserIds()
public
getUserIds() : array<string|int, mixed>
Return values
array<string|int, mixed>getUserIdsFromMention()
public
getUserIdsFromMention() : array<string|int, mixed>
Return values
array<string|int, mixed>getUserIdsToSendMentions()
public
getUserIdsToSendMentions() : array<string|int, mixed>
Return values
array<string|int, mixed>getUuid()
public
getUuid() : string|null
Return values
string|nullhasFiles()
public
hasFiles() : bool
Return values
boolisChanged()
Tells true if object has been changed.
public
isChanged() : bool
Return values
boolisCompletelyEmpty()
public
isCompletelyEmpty() : bool
Return values
boolisDeleted()
Tells true if object marked to drop.
public
isDeleted() : bool
Return values
boolisDisappearing()
public
isDisappearing() : bool
Return values
boolisForward()
public
isForward() : bool
Return values
boolisImportant()
public
isImportant() : bool|null
Return values
bool|nullisNotifyFlash()
public
isNotifyFlash() : bool|null
Return values
bool|nullisNotifyRead()
public
isNotifyRead() : bool|null
Return values
bool|nullisSystem()
public
isSystem() : bool
Return values
boolisUnread()
public
isUnread() : bool
Return values
boolisViewed()
public
isViewed() : bool
Return values
boolisViewedByOthers()
public
isViewedByOthers() : bool
Return values
boolload()
public
load(int|array<string|int, mixed>|EntityObject $source) : Result
Parameters
- $source : int|array<string|int, mixed>|EntityObject
Return values
ResultloadPhrases()
Lazy load message's context phrases.
public
static loadPhrases() : void
mark()
public
mark() : Result
Return values
ResultmarkAsFavorite()
public
markAsFavorite() : Result
Return values
ResultmarkAsImportant()
public
markAsImportant([bool|null $isImportant = true ]) : self
Parameters
- $isImportant : bool|null = true
Return values
selfmarkAsSystem()
public
markAsSystem(bool $flag) : self
Parameters
- $flag : bool
Return values
selfmarkChanged()
Marks object changed.
public
markChanged([bool|null $state = null ]) : static
Parameters
- $state : bool|null = null
Return values
staticmarkDrop()
Marks object to drop on save.
public
markDrop() : static
Return values
staticmarkNotifyAnswer()
public
markNotifyAnswer(bool|null $value) : self
Parameters
- $value : bool|null
Return values
selfmarkNotifyFlash()
public
markNotifyFlash(bool|null $value) : self
Parameters
- $value : bool|null
Return values
selfmarkNotifyRead()
public
markNotifyRead(bool|null $value) : self
Parameters
- $value : bool|null
Return values
selfoffsetExists()
public
offsetExists(mixed $offset) : bool
Parameters
- $offset : mixed
Return values
booloffsetGet()
public
offsetGet(mixed $offset) : mixed
Parameters
- $offset : mixed
offsetSet()
public
offsetSet(mixed $offset, mixed $value) : void
Parameters
- $offset : mixed
- $value : mixed
offsetUnset()
public
offsetUnset(mixed $offset) : void
Parameters
- $offset : mixed
onAfterOrmUpdate()
public
onAfterOrmUpdate(array<string|int, mixed> $fields) : self
Parameters
- $fields : array<string|int, mixed>
Return values
selfparseDates()
Parse dates from message.
public
parseDates() : self
Return values
selfpin()
public
pin() : Result
Return values
ResultprepareFields()
public
prepareFields() : Result
Return values
ResultprocessChangeAuthorId()
public
processChangeAuthorId(int $authorId) : int
Parameters
- $authorId : int
Return values
intprocessChangeNotifyEvent()
public
processChangeNotifyEvent(string|null $notifyEvent) : string|null
Parameters
- $notifyEvent : string|null
Return values
string|nullresetParams()
public
resetParams(array<string|int, mixed> $params) : $this
Parameters
- $params : array<string|int, mixed>
Return values
$thissave()
Saves object state into database.
public
save() : Result
Return values
ResultsetAttach()
public
setAttach(array<string|int, mixed>|Param $attach) : $this
Parameters
- $attach : array<string|int, mixed>|Param
Return values
$thissetAuthorId()
public
setAuthorId(int $authorId) : self
Parameters
- $authorId : int
Return values
selfsetBotId()
public
setBotId(int $botId) : self
Parameters
- $botId : int
Return values
selfsetChat()
public
setChat(Chat $chat) : self
Parameters
- $chat : Chat
Return values
selfsetChatId()
public
setChatId(int $value) : self
Parameters
- $value : int
Return values
selfsetContext()
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
selfsetDateCreate()
public
setDateCreate(DateTime|string|null $value) : static
Parameters
- $value : DateTime|string|null
Return values
staticsetEmailTemplate()
public
setEmailTemplate(string|null $value) : self
Parameters
- $value : string|null
Return values
selfsetFiles()
public
setFiles(array<string|int, int>|FileCollection $files) : static
Parameters
- $files : array<string|int, int>|FileCollection
Return values
staticsetFileUuid()
public
setFileUuid(string|null $uuid) : self
Parameters
- $uuid : string|null
Return values
selfsetForwardUuid()
public
setForwardUuid(string|null $forwardUuid) : self
Parameters
- $forwardUuid : string|null
Return values
selfsetImportantFor()
public
setImportantFor(array<string|int, mixed> $importantFor) : self
Parameters
- $importantFor : array<string|int, mixed>
Return values
selfsetImportId()
public
setImportId(int|null $value) : self
Parameters
- $value : int|null
Return values
selfsetKeyboard()
public
setKeyboard(array<string|int, mixed>|Param|Keyboard $keyboard) : $this
Parameters
Return values
$thissetMenu()
public
setMenu(mixed $menu) : self
Parameters
- $menu : mixed
Return values
selfsetMessage()
public
setMessage(string|null $value) : self
Parameters
- $value : string|null
Return values
selfsetMessageId()
public
setMessageId(int $messageId) : self
Parameters
- $messageId : int
Return values
selfsetMessageOut()
public
setMessageOut(string|null $value) : self
Parameters
- $value : string|null
Return values
selfsetNotifyButtons()
public
setNotifyButtons(mixed $value) : self
Parameters
- $value : mixed
Return values
selfsetNotifyEvent()
Sets source module event id.
public
setNotifyEvent(string|null $notifyEvent) : string|null
Parameters
- $notifyEvent : string|null
Tags
Return values
string|nullsetNotifyLink()
public
setNotifyLink(string|null $value) : self
Parameters
- $value : string|null
Return values
selfsetNotifyModule()
public
setNotifyModule(string|null $value) : self
Parameters
- $value : string|null
Return values
selfsetNotifySubTag()
public
setNotifySubTag(string|null $value) : self
Parameters
- $value : string|null
Return values
selfsetNotifyTag()
public
setNotifyTag(string|null $value) : self
Parameters
- $value : string|null
Return values
selfsetNotifyTitle()
public
setNotifyTitle(string|null $value) : self
Parameters
- $value : string|null
Return values
selfsetNotifyType()
public
setNotifyType(int|null $value) : self
Parameters
- $value : int|null
Return values
selfsetParams()
public
setParams(array<string|int, mixed> $params) : $this
Parameters
- $params : array<string|int, mixed>
Return values
$thissetPrimaryId()
public
setPrimaryId(int $primaryId) : self
Parameters
- $primaryId : int
Return values
selfsetPushAppId()
public
setPushAppId(string|null $message) : self
Parameters
- $message : string|null
Tags
Return values
selfsetPushMessage()
public
setPushMessage(string|null $message) : self
Parameters
- $message : string|null
Tags
Return values
selfsetPushParams()
public
setPushParams(array<string|int, mixed>|null $params) : self
Parameters
- $params : array<string|int, mixed>|null
Tags
Return values
selfsetReactions()
public
setReactions(ReactionMessage $reactions) : $this
Parameters
- $reactions : ReactionMessage
Return values
$thissetRegistry()
public
setRegistry(Registry $registry) : self
Parameters
- $registry : Registry
Return values
selfsetUnread()
public
setUnread(bool $isUnread) : self
Parameters
- $isUnread : bool
Return values
selfsetUrl()
public
setUrl(UrlItem|null $url) : self
Parameters
- $url : UrlItem|null
Return values
selfsetUuid()
public
setUuid(string|null $uuid) : self
Parameters
- $uuid : string|null
Return values
selfsetViewed()
public
setViewed(bool $isViewed) : self
Parameters
- $isViewed : bool
Return values
selftoArray()
Returns object state as array.
public
toArray() : array<string|int, mixed>
Return values
array<string|int, mixed>toRestFormat()
Returns an array in JSON like format to return the entity as a rest response.
public
toRestFormat([array<string|int, mixed> $option = [] ]) : array<string|int, mixed>
Parameters
- $option : array<string|int, mixed> = []
Return values
array<string|int, mixed>unmarkAsFavorite()
public
unmarkAsFavorite() : Result
Return values
Resultunpin()
public
unpin() : Result
Return values
ResultupdateSearchIndex()
Update search index record.
public
updateSearchIndex() : void
uploadFileFromText()
Extracts and saves files from message text.
public
uploadFileFromText() : array<string|int, mixed>
Return values
array<string|int, mixed>withContext()
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