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

Class

SmsMessageResult
Defines the SMS message result entity.

Namespace

Drupal\sms\Entity

Code

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