You are here

SmsProcessingResponse.php in SMS Framework 2.1.x

Same filename and directory in other branches
  1. 8 src/SmsProcessingResponse.php
  2. 2.x src/SmsProcessingResponse.php

Namespace

Drupal\sms

File

src/SmsProcessingResponse.php
View source
<?php

declare (strict_types=1);
namespace Drupal\sms;


/**
 * Defines a container for SMS objects for processing and a request response.
 */
class SmsProcessingResponse {

  /**
   * An array of messages to process.
   *
   * @var \Drupal\sms\Message\SmsMessageInterface[]
   */
  protected $messages = [];

  /**
   * The response to pass to the request controller.
   *
   * @var mixed
   */
  protected $response;

  /**
   * Get an array of messages to process.
   *
   * @return \Drupal\sms\Message\SmsMessageInterface[]
   *   An array of messages to process.
   */
  public function getMessages() {
    return $this->messages;
  }

  /**
   * Set an array of messages to process.
   *
   * @param \Drupal\sms\Message\SmsMessageInterface[] $messages
   *   An array of messages to process.
   *
   * @return $this
   *   Return this object for chaining.
   */
  public function setMessages(array $messages) {
    $this->messages = $messages;
    return $this;
  }

  /**
   * Get the response to pass to the request controller.
   *
   * @return mixed
   *   The response to pass to the request controller.
   */
  public function getResponse() {
    return $this->response;
  }

  /**
   * Set the response to pass to the request controller.
   *
   * @param mixed $response
   *   Set the response to pass to the request controller.
   *
   * @return $this
   *   Return this object for chaining.
   */
  public function setResponse($response) {
    $this->response = $response;
    return $this;
  }

}

Classes

Namesort descending Description
SmsProcessingResponse Defines a container for SMS objects for processing and a request response.