You are here

interface SmsMessageResultInterface in SMS Framework 2.1.x

Same name in this branch
  1. 2.1.x src/Message/SmsMessageResultInterface.php \Drupal\sms\Message\SmsMessageResultInterface
  2. 2.1.x src/Entity/SmsMessageResultInterface.php \Drupal\sms\Entity\SmsMessageResultInterface
Same name and namespace in other branches
  1. 8 src/Message/SmsMessageResultInterface.php \Drupal\sms\Message\SmsMessageResultInterface
  2. 2.x src/Message/SmsMessageResultInterface.php \Drupal\sms\Message\SmsMessageResultInterface

Contains information on SMS message results.

Hierarchy

Expanded class hierarchy of SmsMessageResultInterface

All classes that implement SmsMessageResultInterface

9 files declare their use of SmsMessageResultInterface
SmsFrameworkDeliveryReportTest.php in tests/src/Functional/SmsFrameworkDeliveryReportTest.php
SmsFrameworkMessageEntityTest.php in tests/src/Kernel/SmsFrameworkMessageEntityTest.php
SmsFrameworkMessageResultTestTrait.php in tests/src/Functional/SmsFrameworkMessageResultTestTrait.php
SmsFrameworkProviderTest.php in tests/src/Kernel/SmsFrameworkProviderTest.php
SmsFrameworkSmsSendTest.php in tests/src/Kernel/SmsFrameworkSmsSendTest.php

... See full list

File

src/Message/SmsMessageResultInterface.php, line 10

Namespace

Drupal\sms\Message
View source
interface SmsMessageResultInterface {

  /**
   * Gets the error of the message.
   *
   * @return string|null
   *   A error code from \Drupal\sms\Message\SmsMessageResultError, or NULL if
   *   there was no error.
   */
  public function getError();

  /**
   * Sets the error of the message.
   *
   * Usually a setting an error on a result indicates something went wrong with
   * the entire transaction.
   *
   * @param string|null $error
   *   A error code from \Drupal\sms\Message\SmsMessageResultError, or NULL if
   *   unknown.
   *
   * @return $this
   *   Returns this result object for chaining.
   */
  public function setError($error);

  /**
   * Gets the error message.
   *
   * @return string
   *   The error message as provided by the gateway API.
   */
  public function getErrorMessage();

  /**
   * Sets the error message.
   *
   * @param string $message
   *   The error message as provided by the gateway API.
   *
   * @return $this
   *   Returns this report object for chaining.
   */
  public function setErrorMessage($message);

  /**
   * Gets the delivery report for a particular recipient.
   *
   * @param string $recipient
   *   The number of the recipient for which the report is to be retrieved.
   *
   * @return \Drupal\sms\Message\SmsDeliveryReportInterface|null
   *   A delivery report object, or NULL if there is no report for the
   *   recipient.
   *
   * @see SmsMessageResultInterface::getReports()
   */
  public function getReport($recipient);

  /**
   * Gets the delivery reports for all recipients.
   *
   * @return \Drupal\sms\Message\SmsDeliveryReportInterface[]
   *   An array of delivery reports.
   */
  public function getReports();

  /**
   * Sets the delivery reports for all recipients.
   *
   * @param \Drupal\sms\Message\SmsDeliveryReportInterface[] $reports
   *   An array of delivery reports.
   *
   * @return $this
   *   Returns this result object for chaining.
   */
  public function setReports(array $reports);

  /**
   * Adds a delivery report to the result.
   *
   * @param \Drupal\sms\Message\SmsDeliveryReportInterface $report
   *   A delivery report.
   *
   * @return $this
   *   Returns this result object for chaining.
   */
  public function addReport(SmsDeliveryReportInterface $report);

  /**
   * Gets the credit balance after this transaction.
   *
   * @return float|null
   *   The credit balance after the message is processed, or NULL if unknown.
   */
  public function getCreditsBalance();

  /**
   * Sets the credit balance after this transaction.
   *
   * @param float|null $balance
   *   The credit balance after the message is processed, or NULL if unknown.
   *
   * @return $this
   *   Returns this result object for chaining.
   *
   * @throws \Drupal\sms\Exception\SmsException
   *   Thrown if balance set is an invalid variable type.
   */
  public function setCreditsBalance($balance);

  /**
   * Gets the credits consumed for this transaction.
   *
   * @return float|null
   *   The credits consumed for this transaction, or NULL if unknown.
   */
  public function getCreditsUsed();

  /**
   * Sets the credits consumed for this transaction.
   *
   * @param float|null $credits_used
   *   The credits consumed for this transaction, or NULL if unknown.
   *
   * @return $this
   *   Returns this result object for chaining.
   *
   * @throws \Drupal\sms\Exception\SmsException
   *   Thrown if credits set is an invalid variable type.
   */
  public function setCreditsUsed($credits_used);

}

Members

Namesort descending Modifiers Type Description Overrides
SmsMessageResultInterface::addReport public function Adds a delivery report to the result. 2
SmsMessageResultInterface::getCreditsBalance public function Gets the credit balance after this transaction. 2
SmsMessageResultInterface::getCreditsUsed public function Gets the credits consumed for this transaction. 2
SmsMessageResultInterface::getError public function Gets the error of the message. 2
SmsMessageResultInterface::getErrorMessage public function Gets the error message. 2
SmsMessageResultInterface::getReport public function Gets the delivery report for a particular recipient. 2
SmsMessageResultInterface::getReports public function Gets the delivery reports for all recipients. 2
SmsMessageResultInterface::setCreditsBalance public function Sets the credit balance after this transaction. 2
SmsMessageResultInterface::setCreditsUsed public function Sets the credits consumed for this transaction. 2
SmsMessageResultInterface::setError public function Sets the error of the message. 2
SmsMessageResultInterface::setErrorMessage public function Sets the error message. 2
SmsMessageResultInterface::setReports public function Sets the delivery reports for all recipients. 2