You are here

public function SmsMessage::__construct in SMS Framework 8

Same name and namespace in other branches
  1. 2.x src/Message/SmsMessage.php \Drupal\sms\Message\SmsMessage::__construct()
  2. 2.1.x src/Message/SmsMessage.php \Drupal\sms\Message\SmsMessage::__construct()

Creates a new instance of an SMS message.

Parameters

string $sender_phone_number: (optional) The senders' phone number.

array $recipients: (optional) The list of recipient phone numbers for the message.

string $message: (optional) The actual SMS message to be sent.

array $options: (optional) Additional options.

int $uid: (optional) The user who created the SMS message.

File

src/Message/SmsMessage.php, line 106

Class

SmsMessage
Basic implementation of an SMS message.

Namespace

Drupal\sms\Message

Code

public function __construct($sender_phone_number = NULL, array $recipients = [], $message = '', array $options = [], $uid = NULL) {
  $this
    ->setSenderNumber($sender_phone_number);
  $this
    ->addRecipients($recipients);
  $this
    ->setMessage($message);
  $this->message = $message;
  $this->options = $options;
  $this
    ->setUid($uid);
  $this->uuid = $this
    ->uuidGenerator()
    ->generate();
}