You are here

class SparkpostQueuedMessageWrapper in Sparkpost email 7.2

Same name and namespace in other branches
  1. 7 modules/sparkpost_requeue/sparkpost_requeue.queue_message_wrapper.inc \SparkpostQueuedMessageWrapper

@file Class for queued messages.

Hierarchy

Expanded class hierarchy of SparkpostQueuedMessageWrapper

File

modules/sparkpost_requeue/sparkpost_requeue.queue_message_wrapper.inc, line 8
Class for queued messages.

View source
class SparkpostQueuedMessageWrapper extends SparkpostMessageWrapper implements SparkpostMessageWrapperInterface {

  /**
   * The number of tries we have had with this one.
   *
   * @var int
   */
  protected $retryCount = 0;

  /**
   * Last retry timestamp.
   *
   * @var int
   */
  protected $lastRetry = 0;

  /**
   * SparkpostQueuedMessageWrapper constructor.
   *
   * @param \SparkpostMessageWrapper $message_wrapper
   *   The message wrapper instance. So we can just re-use that.
   */
  public function __construct(SparkpostMessageWrapper $message_wrapper) {
    parent::__construct($message_wrapper
      ->getSparkpostMessage(), $message_wrapper
      ->getDrupalMessage());
    if ($message_wrapper
      ->getResult()) {
      $this
        ->setResult($message_wrapper
        ->getResult());
    }
    if ($message_wrapper
      ->getApiResponseException()) {
      $this
        ->setApiResponseException($message_wrapper
        ->getApiResponseException());
    }
  }

  /**
   * Get the count of retries.
   *
   * @return int
   *   The number of retries we have had.
   */
  public function getRetryCount() {
    return $this->retryCount;
  }

  /**
   * Increment the retry count.
   */
  public function incrementRetryCount() {
    $this->retryCount++;
  }

  /**
   * @return int
   */
  public function getLastRetry() {
    return $this->lastRetry;
  }

  /**
   * @param int $lastRetry
   */
  public function setLastRetry($lastRetry) {
    $this->lastRetry = $lastRetry;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
SparkpostMessageWrapper::$apiResponseException protected property
SparkpostMessageWrapper::$drupalMessage protected property
SparkpostMessageWrapper::$result protected property
SparkpostMessageWrapper::$sparkpostMessage protected property
SparkpostMessageWrapper::getApiResponseException public function Overrides SparkpostMessageWrapperInterface::getApiResponseException
SparkpostMessageWrapper::getDrupalMessage public function Overrides SparkpostMessageWrapperInterface::getDrupalMessage
SparkpostMessageWrapper::getResult public function Overrides SparkpostMessageWrapperInterface::getResult
SparkpostMessageWrapper::getSparkpostMessage public function Overrides SparkpostMessageWrapperInterface::getSparkpostMessage
SparkpostMessageWrapper::setApiResponseException public function Overrides SparkpostMessageWrapperInterface::setApiResponseException
SparkpostMessageWrapper::setDrupalMessage public function Overrides SparkpostMessageWrapperInterface::setDrupalMessage
SparkpostMessageWrapper::setResult public function Overrides SparkpostMessageWrapperInterface::setResult
SparkpostMessageWrapper::setSparkpostMessage public function Overrides SparkpostMessageWrapperInterface::setSparkpostMessage
SparkpostQueuedMessageWrapper::$lastRetry protected property Last retry timestamp.
SparkpostQueuedMessageWrapper::$retryCount protected property The number of tries we have had with this one.
SparkpostQueuedMessageWrapper::getLastRetry public function
SparkpostQueuedMessageWrapper::getRetryCount public function Get the count of retries.
SparkpostQueuedMessageWrapper::incrementRetryCount public function Increment the retry count.
SparkpostQueuedMessageWrapper::setLastRetry public function
SparkpostQueuedMessageWrapper::__construct public function SparkpostQueuedMessageWrapper constructor. Overrides SparkpostMessageWrapper::__construct