Message
Table of Contents
Constants
- EVENT_MESSAGE_UPDATED = 'messageUpdated'
Methods
- __construct() : mixed
- Message constructor.
- checkFields() : Result
- createFromFields() : Message
- getAuthorId() : int
- getBody() : mixed
- getError() : Error|null
- getFieldsById() : mixed
- getFrom() : mixed
- getHeaders() : array<string|int, mixed>
- getSender() : Base|null
- getStatusId() : mixed
- getTo() : mixed
- getType() : string
- loadByExternalId() : Message|null
- loadById() : Message|null
- send() : AddResult
- sendDirectly() : SendMessage
- setAuthorId() : Message
- setBody() : $this
- setCheckRestrictions() : void
- setError() : Message
- setFrom() : $this
- setHeaders() : Message
- setSender() : $this
- setTo() : $this
- setType() : Message
- update() : bool
- updateStatus() : bool
- updateStatusByExternalStatus() : bool
- updateWithSendResult() : void
Constants
EVENT_MESSAGE_UPDATED
public
mixed
EVENT_MESSAGE_UPDATED
= 'messageUpdated'
Methods
__construct()
Message constructor.
public
__construct([Base|null $sender = null ]) : mixed
Parameters
- $sender : Base|null = null
checkFields()
public
checkFields() : Result
Return values
ResultcreateFromFields()
public
static createFromFields(array<string|int, mixed> $fields[, Base|null $sender = null ]) : Message
Parameters
- $fields : array<string|int, mixed>
- $sender : Base|null = null
Return values
MessagegetAuthorId()
public
getAuthorId() : int
Return values
intgetBody()
public
getBody() : mixed
getError()
public
getError() : Error|null
Return values
Error|nullgetFieldsById()
public
static getFieldsById(mixed $messageId) : mixed
Parameters
- $messageId : mixed
getFrom()
public
getFrom() : mixed
getHeaders()
public
getHeaders() : array<string|int, mixed>
Return values
array<string|int, mixed>getSender()
public
getSender() : Base|null
Return values
Base|nullgetStatusId()
public
getStatusId() : mixed
getTo()
public
getTo() : mixed
getType()
public
getType() : string
Return values
stringloadByExternalId()
public
static loadByExternalId(string $senderId, string $externalId[, string|null $from = null ]) : Message|null
Parameters
- $senderId : string
- $externalId : string
- $from : string|null = null
Return values
Message|nullloadById()
public
static loadById(int $id) : Message|null
Parameters
- $id : int
Return values
Message|nullsend()
public
send() : AddResult
Return values
AddResult —Created Message result.
sendDirectly()
public
sendDirectly() : SendMessage
Return values
SendMessagesetAuthorId()
public
setAuthorId(int $authorId) : Message
Parameters
- $authorId : int
Return values
MessagesetBody()
public
setBody(mixed $body) : $this
Parameters
- $body : mixed
Return values
$thissetCheckRestrictions()
public
setCheckRestrictions(bool $checkRestrictions) : void
Parameters
- $checkRestrictions : bool
setError()
public
setError(Error $error) : Message
Parameters
- $error : Error
Return values
MessagesetFrom()
public
setFrom(mixed $from) : $this
Parameters
- $from : mixed
Return values
$thissetHeaders()
public
setHeaders(array<string|int, mixed> $headers) : Message
Parameters
- $headers : array<string|int, mixed>
Return values
MessagesetSender()
public
setSender(Base $sender) : $this
Parameters
- $sender : Base
Return values
$thissetTo()
public
setTo(mixed $to) : $this
Parameters
- $to : mixed
Return values
$thissetType()
public
setType(string $type) : Message
Parameters
- $type : string
Tags
Return values
Messageupdate()
public
update(array<string|int, mixed> $fields) : bool
Parameters
- $fields : array<string|int, mixed>
Return values
boolupdateStatus()
public
updateStatus(int $newStatusId) : bool
Parameters
- $newStatusId : int
Return values
boolupdateStatusByExternalStatus()
public
updateStatusByExternalStatus(string $externalStatus) : bool
Parameters
- $externalStatus : string
Return values
boolupdateWithSendResult()
public
updateWithSendResult(SendMessage $result, DateTime $nextExec) : void
Parameters
- $result : SendMessage
- $nextExec : DateTime