Moodle PHP Documentation 4.5
Moodle 4.5.5+ (Build: 20250711) (ce34e8ff087)
core_sms\gateway Class Reference
Inheritance diagram for core_sms\gateway:
smsgateway_aws\gateway

Public Member Functions

 __construct (public bool readonly bool $enabled, public string string $name, string $config, public null|int readonly ?int $id=null,)
 Create a new gateway.
 
 can_send (message $message)
 Confirm whether this gateway can send the given message.
 
 get_send_priority (message $message)
 Get the priority of this gateway for sending the given message.
 
 send (message $message)
 Send the given message.
 
 to_record ()
 Convert this object to a stdClass.
 
 update_message_status (message $message)
 Update the status of the given message from the gateway.
 
 update_message_statuses (array $messages)
 Update the statuses of the given messages from the gateway.
 

Public Attributes

stdClass readonly stdClass $config
 The configuration for this instance.
 

Constructor & Destructor Documentation

◆ __construct()

core_sms\gateway::__construct ( public bool readonly bool $enabled,
public string string $name,
string $config,
public null|int readonly ?int $id = null )

Create a new gateway.

Parameters
bool$enabledWhether the gateway is enabled
string$nameThe name of the gateway config
string$configThe configuration for this instance
int | null$idThe id of the gateway in the database
Parameters
$enabledWhether the gateway is enabled
$nameThe name of the gateway config
$idThe ID of the gateway in the database, or null if it has not been persisted yet

Member Function Documentation

◆ can_send()

core_sms\gateway::can_send ( message $message)

Confirm whether this gateway can send the given message.

Parameters
message$message
Return values
bool

◆ get_send_priority()

core_sms\gateway::get_send_priority ( message $message)
abstract

Get the priority of this gateway for sending the given message.

A priority of 0 means that the gateway cannot send the message. Higher values are higher priority.

This method is called frequently, so should be fast. If calculation is expensive the value should be cached.

Parameters
message$message
Return values
int

Reimplemented in smsgateway_aws\gateway.

◆ send()

core_sms\gateway::send ( message $message)
abstract

Send the given message.

Parameters
message$message
Return values
message

Reimplemented in smsgateway_aws\gateway.

◆ to_record()

core_sms\gateway::to_record ( )

Convert this object to a stdClass.

Return values
stdClass

◆ update_message_status()

core_sms\gateway::update_message_status ( message $message)

Update the status of the given message from the gateway.

Parameters
message$message
Return values
message
Exceptions
coding_exception

◆ update_message_statuses()

core_sms\gateway::update_message_statuses ( array $messages)

Update the statuses of the given messages from the gateway.

Parameters
message[]$messages
Return values
message[]

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