You are here

public function Memory::incomingEvent in SMS Framework 2.1.x

Same name and namespace in other branches
  1. 8 tests/modules/sms_test_gateway/src/Plugin/SmsGateway/Memory.php \Drupal\sms_test_gateway\Plugin\SmsGateway\Memory::incomingEvent()
  2. 2.x tests/modules/sms_test_gateway/src/Plugin/SmsGateway/Memory.php \Drupal\sms_test_gateway\Plugin\SmsGateway\Memory::incomingEvent()

Process a SMS message from this gateway.

Parameters

\Drupal\sms\Event\SmsMessageEvent $event: The event.

Overrides SmsIncomingEventProcessorInterface::incomingEvent

File

tests/modules/sms_test_gateway/src/Plugin/SmsGateway/Memory.php, line 96

Class

Memory
Defines a gateway storing transmitted SMS in memory.

Namespace

Drupal\sms_test_gateway\Plugin\SmsGateway

Code

public function incomingEvent(SmsMessageEvent $event) {

  // @todo Contents of this method are subject to proposals made in
  // https://www.drupal.org/node/2712579
  // Set state so we test this method is executed, remove this after above is
  // addressed.
  \Drupal::state()
    ->set('sms_test_gateway.memory.incoming', TRUE);
  $execution_order = \Drupal::state()
    ->get('sms_test_event_subscriber__execution_order', []);
  $execution_order[] = __METHOD__;
  \Drupal::state()
    ->set('sms_test_event_subscriber__execution_order', $execution_order);
}