Moodle PHP Documentation 5.1
Moodle 5.1dev (Build: 20250706) (a6b17d8f6bd)
core_sms\message Class Reference

Public Member Functions

 __construct (public string readonly string $recipientnumber, public null|string readonly ?string $content, public string readonly string $component, public string readonly string $messagetype, public int|null readonly ?int $recipientuserid, public bool readonly bool $issensitive, public null|int readonly ?int $id=null, public message_status readonly message_status $status=message_status::UNKNOWN, public null|int readonly ?int $gatewayid=null, ?int $timecreated=null,)
 Create a new message.
 
 get_region ()
 Get the region code for this messages.
 
 is_sent ()
 Check if the message has been sent.
 
 to_record ()
 Convert the message to a record.
 
 with (... $args)
 Update the message properties.
 

Public Attributes

int readonly int $timecreated
 The time that the message was created.
 

Constructor & Destructor Documentation

◆ __construct()

core_sms\message::__construct ( public string readonly string $recipientnumber,
public null|string readonly ?string $content,
public string readonly string $component,
public string readonly string $messagetype,
public int|null readonly ?int $recipientuserid,
public bool readonly bool $issensitive,
public null|int readonly ?int $id = null,
public message_status readonly message_status $status = message_status::UNKNOWN,
public null|int readonly ?int $gatewayid = null,
?int $timecreated = null )

Create a new message.

Parameters
string$recipientnumberThe phone number of the message recipient
null | string$contentThe content of the message
string$componentThe component that owns the message
string$messagetypeThe type of message within the component
int | null$recipientuseridThe user id of the recipient if one exists
bool$issensitiveWhether this message contains sensitive information
int | null$idThe id of the message in the database
message_status$statusThe status of the message
int | null$gatewayidThe id of the gateway that sent the message
int | null$timecreatedThe time that the message was created
Parameters
$recipientnumberThe phone number of the message recipient
$contentThe content of the message
$componentThe component that owns the message
$messagetypeThe type of message within the component
$recipientuseridThe user id of the recipient if one exists
$issensitiveWhether this message contains sensitive information
$idThe id of the message in the database
$statusThe status of the message
$gatewayidThe id of the gateway that sent the message

Member Function Documentation

◆ get_region()

core_sms\message::get_region ( )

Get the region code for this messages.

Return values
null|string

◆ is_sent()

core_sms\message::is_sent ( )

Check if the message has been sent.

Return values
bool

◆ to_record()

core_sms\message::to_record ( )

Convert the message to a record.

Return values
stdClass

◆ with()

core_sms\message::with ( ...)

Update the message properties.

Note: The message is immutable. When setting the status a new object will be returned.

Parameters
mixed...$args
Return values
message

The documentation for this class was generated from the following file: