You are here

protected function DefaultSmsProvider::dispatchEvent in SMS Framework 8

Same name and namespace in other branches
  1. 2.x src/Provider/DefaultSmsProvider.php \Drupal\sms\Provider\DefaultSmsProvider::dispatchEvent()
  2. 2.1.x src/Provider/DefaultSmsProvider.php \Drupal\sms\Provider\DefaultSmsProvider::dispatchEvent()

Dispatch an SmsMessageEvent event for messages.

Parameters

string $event_name: The event to trigger.

\Drupal\sms\Message\SmsMessageInterface[] $sms_messages: The messages to dispatch.

Return value

\Drupal\sms\Event\SmsMessageEvent The dispatched event.

2 calls to DefaultSmsProvider::dispatchEvent()
DefaultSmsProvider::incoming in src/Provider/DefaultSmsProvider.php
Handles a message sent from the gateway to the site.
DefaultSmsProvider::send in src/Provider/DefaultSmsProvider.php
Sends an SMS using the active gateway.

File

src/Provider/DefaultSmsProvider.php, line 172

Class

DefaultSmsProvider
The SMS provider that provides default messaging functionality.

Namespace

Drupal\sms\Provider

Code

protected function dispatchEvent($event_name, array $sms_messages) {
  $event = new SmsMessageEvent($sms_messages);
  return $this->eventDispatcher
    ->dispatch($event_name, $event);
}