You are here

class SmsMessageEvent in SMS Framework 8

Same name and namespace in other branches
  1. 2.x src/Event/SmsMessageEvent.php \Drupal\sms\Event\SmsMessageEvent
  2. 2.1.x src/Event/SmsMessageEvent.php \Drupal\sms\Event\SmsMessageEvent

Event fired when SMS messages are processed.

This event can be used for both pre- and post- process events. See {@link \Drupal\sms\Event\SmsEvents} to see where this event is used.

Hierarchy

  • class \Drupal\sms\Event\SmsMessageEvent extends \Symfony\Component\EventDispatcher\Event

Expanded class hierarchy of SmsMessageEvent

See also

\Drupal\sms\Event\SmsEvents

7 files declare their use of SmsMessageEvent
DefaultSmsProvider.php in src/Provider/DefaultSmsProvider.php
Memory.php in tests/modules/sms_test_gateway/src/Plugin/SmsGateway/Memory.php
SmsEventSubscriber.php in modules/sms_user/src/EventSubscriber/SmsEventSubscriber.php
SmsIncomingEventInterface.php in src/Plugin/SmsGateway/SmsIncomingEventInterface.php
SmsIncomingEventProcessorInterface.php in src/Plugin/SmsGateway/SmsIncomingEventProcessorInterface.php

... See full list

File

src/Event/SmsMessageEvent.php, line 15

Namespace

Drupal\sms\Event
View source
class SmsMessageEvent extends Event {

  /**
   * The SMS messages.
   *
   * @var \Drupal\sms\Message\SmsMessageInterface[]
   */
  protected $messages;

  /**
   * Constructs the object.
   *
   * @param \Drupal\sms\Message\SmsMessageInterface[] $messages
   *   The SMS message.
   */
  public function __construct(array $messages) {
    $this
      ->setMessages($messages);
  }

  /**
   * Get all messages on this event.
   *
   * @return \Drupal\sms\Message\SmsMessageInterface[]
   *   The messages on this event.
   */
  public function getMessages() {
    return $this->messages;
  }

  /**
   * Set the messages on this event.
   *
   * @param \Drupal\sms\Message\SmsMessageInterface[] $messages
   *   The messages to set on this event.
   *
   * @return $this
   *   Returns this event for chaining.
   */
  public function setMessages(array $messages) {
    $this->messages = $messages;
    return $this;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
SmsMessageEvent::$messages protected property The SMS messages.
SmsMessageEvent::getMessages public function Get all messages on this event.
SmsMessageEvent::setMessages public function Set the messages on this event.
SmsMessageEvent::__construct public function Constructs the object.