|
stdClass readonly stdClass | $config |
| The configuration for this instance.
|
|
|
int const | MESSAGE_LENGTH_LIMIT = 160 * 3 |
| The maximum length of a message.
|
|
◆ __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 | $enabled | Whether the gateway is enabled |
string | $name | The name of the gateway config |
string | $config | The configuration for this instance |
int | null | $id | The id of the gateway in the database |
- Parameters
-
$enabled | Whether the gateway is enabled |
$name | The name of the gateway config |
$id | The ID of the gateway in the database, or null if it has not been persisted yet |
◆ can_send()
core_sms\gateway::can_send |
( |
message | $message | ) |
|
Confirm whether this gateway can send the given message.
- Parameters
-
- Return values
-
◆ 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
-
- Return values
-
Reimplemented in smsgateway_aws\gateway, and smsgateway_modica\gateway.
◆ send()
core_sms\gateway::send |
( |
message | $message | ) |
|
|
abstract |
◆ to_record()
core_sms\gateway::to_record |
( |
| ) |
|
Convert this object to a stdClass.
- Return values
-
◆ truncate_message()
core_sms\gateway::truncate_message |
( |
string | $message | ) |
|
Truncates the given message to fit the constraints.
- Parameters
-
string | $message | The message to be truncated. |
- Return values
-
string | The truncated message. |
◆ update_message_status()
core_sms\gateway::update_message_status |
( |
message | $message | ) |
|
Update the status of the given message from the gateway.
- Parameters
-
- Return values
-
- Exceptions
-
◆ update_message_statuses()
core_sms\gateway::update_message_statuses |
( |
array | $messages | ) |
|
Update the statuses of the given messages from the gateway.
- Parameters
-
- Return values
-
The documentation for this class was generated from the following file: