You are here

public function SmsMessageResult::getReport in SMS Framework 2.1.x

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

Gets the delivery report for a particular recipient.

Parameters

string $recipient: The number of the recipient for which the report is to be retrieved.

Return value

\Drupal\sms\Message\SmsDeliveryReportInterface|null A delivery report object, or NULL if there is no report for the recipient.

Overrides SmsMessageResultInterface::getReport

See also

SmsMessageResultInterface::getReports()

File

src/Message/SmsMessageResult.php, line 86

Class

SmsMessageResult
The result of an SMS messaging transaction.

Namespace

Drupal\sms\Message

Code

public function getReport($recipient) {
  foreach ($this->reports as $report) {
    if ($report
      ->getRecipient() == $recipient) {
      return $report;
    }
  }
  return NULL;
}