You are here

public function SmsMessage::addRecipient in SMS Framework 8

Same name in this branch
  1. 8 src/Message/SmsMessage.php \Drupal\sms\Message\SmsMessage::addRecipient()
  2. 8 src/Entity/SmsMessage.php \Drupal\sms\Entity\SmsMessage::addRecipient()
Same name and namespace in other branches
  1. 2.x src/Message/SmsMessage.php \Drupal\sms\Message\SmsMessage::addRecipient()
  2. 2.1.x src/Message/SmsMessage.php \Drupal\sms\Message\SmsMessage::addRecipient()

Adds a single recipient to the SMS message.

Parameters

string $recipient: The recipient to add.

Return value

$this The called SMS message object.

Overrides SmsMessageInterface::addRecipient

1 call to SmsMessage::addRecipient()
SmsMessage::addRecipients in src/Message/SmsMessage.php
Adds multiple recipients to the SMS message.

File

src/Message/SmsMessage.php, line 171

Class

SmsMessage
Basic implementation of an SMS message.

Namespace

Drupal\sms\Message

Code

public function addRecipient($recipient) {
  if (!in_array($recipient, $this->recipients)) {
    $this->recipients[] = $recipient;
  }
  return $this;
}