Documentation

CiviTestSMSProvider extends CRM_SMS_Provider
in package

Test SMS provider to allow for testing

Table of Contents

Constants

MAX_SMS_CHAR  = 460

Properties

$_id  : mixed
$provider  : mixed
$sentMessage  : mixed
$_singleton  : object
We only need one instance of this object. So we use the singleton pattern and cache the instance in this variable

Methods

__construct()  : mixed
createActivity()  : self|null|object
formatPhone()  : mixed|string
getSentMessage()  : string
Get the message that was sent.
processInbound()  : self|null|object
retrieve()  : mixed
send()  : mixed
Send an SMS Message via the API Server.
singleton()  : object
Singleton function used to manage this object.
stripPhone()  : mixed|string
urlEncode()  : string
formatPhoneNumber()  : string
Format phone number with % - this may no longer make sense as we now compare with phone_numeric.

Constants

MAX_SMS_CHAR

public mixed MAX_SMS_CHAR = 460

Properties

$_singleton

We only need one instance of this object. So we use the singleton pattern and cache the instance in this variable

private static object $_singleton = []

Methods

__construct()

public __construct(mixed $provider[, mixed $skipAuth = TRUE ]) : mixed
Parameters
$provider : mixed
$skipAuth : mixed = TRUE

createActivity()

public createActivity(int $apiMsgID, mixed $message[, array<string|int, mixed> $headers = [] ][, int $jobID = NULL ][, int $userID = NULL ]) : self|null|object
Parameters
$apiMsgID : int
$message : mixed
$headers : array<string|int, mixed> = []
$jobID : int = NULL
$userID : int = NULL
Tags
throws
CRM_Core_Exception
Return values
self|null|object

formatPhone()

public formatPhone(mixed $phone, mixed &$kind[, string $format = "dash" ]) : mixed|string

since 5.73 will be removed around 5.95

Parameters
$phone : mixed
$kind : mixed
$format : string = "dash"
Return values
mixed|string

getSentMessage()

Get the message that was sent.

public getSentMessage() : string
Return values
string

processInbound()

public processInbound(mixed $from, mixed $body[, null $to = NULL ][, int $trackID = NULL ]) : self|null|object
Parameters
$from : mixed
$body : mixed
$to : null = NULL
$trackID : int = NULL
Tags
throws
CRM_Core_Exception
Return values
self|null|object

retrieve()

public retrieve(string $name, mixed $type[, bool $abort = TRUE ][, null $default = NULL ][, string $location = 'REQUEST' ]) : mixed
Parameters
$name : string
$type : mixed
$abort : bool = TRUE
$default : null = NULL
$location : string = 'REQUEST'

send()

Send an SMS Message via the API Server.

public send(mixed $recipients, mixed $header, mixed $message[, mixed $dncID = NULL ]) : mixed
Parameters
$recipients : mixed
$header : mixed
$message : mixed
$dncID : mixed = NULL

singleton()

Singleton function used to manage this object.

public static & singleton([mixed $providerParams = [] ][, mixed $force = FALSE ]) : object
Parameters
$providerParams : mixed = []
$force : mixed = FALSE
Return values
object

stripPhone()

public stripPhone(mixed $phone) : mixed|string
Parameters
$phone : mixed
Return values
mixed|string

urlEncode()

public urlEncode(mixed $values) : string
Parameters
$values : mixed
Return values
string

formatPhoneNumber()

Format phone number with % - this may no longer make sense as we now compare with phone_numeric.

private formatPhoneNumber(string $phone) : string
Parameters
$phone : string
Return values
string

        
On this page

Search results