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/Entity/SmsMessageResult.php \Drupal\sms\Entity\SmsMessageResult::setError()
  2. 2.1.x src/Entity/SmsMessageResult.php \Drupal\sms\Entity\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/Entity/SmsMessageResult.php, line 55

Class

SmsMessageResult
Defines the SMS message result entity.

Namespace

Drupal\sms\Entity

Code

public function setError($error) {
  $this
    ->set('error', $error);
  return $this;
}