You are here

abstract class SmsParserBase in SMS Framework 7

Base implementation of SmsParserInterface().

Hierarchy

Expanded class hierarchy of SmsParserBase

File

./sms.parser.inc, line 102

View source
abstract class SmsParserBase implements SmsParserInterface {

  /**
   * The request being parsed.
   *
   * @var array
   */
  protected $request;

  /**
   * The SMS sender number.
   *
   * @var string
   */
  protected $number;

  /**
   * The SMS body.
   *
   * @var string
   */
  protected $message;

  /**
   * The sms_incoming options.
   *
   * @var array
   */
  protected $options;

  /**
   * {@inheritdoc}
   */
  static function checkAccess($originator, $request) {
    return TRUE;
  }

  /**
   * {@inheritdoc}
   */
  public function __construct($request = array()) {
    $this->request = $request;
    $this->number = '';
    $this->message = '';
    $this->options = array();
  }

  /**
   * {@inheritdoc}
   */
  public function setRequest($request) {
    $this->request = $request;
  }

  /**
   * {@inheritdoc}
   */
  public function getNumber() {
    return $this->number;
  }

  /**
   * {@inheritdoc}
   */
  public function getMessage() {
    return $this->message;
  }

  /**
   * {@inheritdoc}
   */
  public function getOptions() {
    return $this->options;
  }

  /**
   * {@inheritdoc}
   */
  public abstract function parseRequest();

  /**
   * {@inheritdoc}
   */
  public function getResponse() {
    return array(
      'headers' => array(
        // Even though we should have a body entity to return.
        'Status' => '202 Accepted',
      ),
      'body' => '',
    );
  }

}

Members

Namesort descending Modifiers Type Description Overrides
SmsParserBase::$message protected property The SMS body.
SmsParserBase::$number protected property The SMS sender number.
SmsParserBase::$options protected property The sms_incoming options.
SmsParserBase::$request protected property The request being parsed.
SmsParserBase::checkAccess static function Checks access to parser for incoming SMS. Overrides SmsParserInterface::checkAccess
SmsParserBase::getMessage public function Retrieves SMS message content. Overrides SmsParserInterface::getMessage
SmsParserBase::getNumber public function Retrieves SMS sender number. Overrides SmsParserInterface::getNumber
SmsParserBase::getOptions public function Retrieves sms_incoming() options. Overrides SmsParserInterface::getOptions
SmsParserBase::getResponse public function Retrieves the response if any. Overrides SmsParserInterface::getResponse
SmsParserBase::parseRequest abstract public function Parses the request. Overrides SmsParserInterface::parseRequest
SmsParserBase::setRequest public function Sets the request. Overrides SmsParserInterface::setRequest
SmsParserBase::__construct public function Starts a parser. Load URI information. Overrides SmsParserInterface::__construct