You are here

public function SmsMessageResult::setError in SMS Framework 8

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

Sets the error of the message.

Usually a setting an error on a result indicates something went wrong with the entire transaction.

Parameters

string|null $error: A error code from \Drupal\sms\Message\SmsMessageResultError, or NULL if unknown.

Return value

$this Returns this result object for chaining.

Overrides SmsMessageResultInterface::setError

File

src/Message/SmsMessageResult.php, line 61

Class

SmsMessageResult
The result of an SMS messaging transaction.

Namespace

Drupal\sms\Message

Code

public function setError($error) {
  $this->error = $error;
  return $this;
}