class QueuedMessageWrapper in Sparkpost email 8.2
Queued message wrapper class.
Hierarchy
- class \Drupal\sparkpost\MessageWrapper implements MessageWrapperInterface uses DependencySerializationTrait
- class \Drupal\sparkpost_requeue\QueuedMessageWrapper implements MessageWrapperInterface
Expanded class hierarchy of QueuedMessageWrapper
1 file declares its use of QueuedMessageWrapper
- sparkpost_requeue.module in modules/
sparkpost_requeue/ sparkpost_requeue.module - Sparkpost requeue module.
File
- modules/
sparkpost_requeue/ src/ QueuedMessageWrapper.php, line 12
Namespace
Drupal\sparkpost_requeueView source
class QueuedMessageWrapper extends MessageWrapper implements MessageWrapperInterface {
/**
* The number of tries we have had with this one.
*
* @var int
*/
protected $retryCount = 0;
/**
* Last retry timestamp.
*
* @var int
*/
protected $lastRetry = 0;
/**
* Client to use.
*
* @var \Drupal\sparkpost\ClientServiceInterface
*/
protected $clientService;
/**
* QueuedMessageWrapper constructor.
*/
public function __construct(ClientServiceInterface $clientService) {
$this->clientService = $clientService;
if ($this
->getResult()) {
$this
->setResult($this
->getResult());
}
if ($this
->getApiResponseException()) {
$this
->setApiResponseException($this
->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++;
}
/**
* Gets the last retry.
*
* @return int
* The last retry timestamp.
*/
public function getLastRetry() {
return $this->lastRetry;
}
/**
* Sets the last retry timestamp.
*
* @param int $lastRetry
* A timestamp.
*/
public function setLastRetry($lastRetry) {
$this->lastRetry = $lastRetry;
}
}