You are here

public function AcquiaPurgeQueueStatusTrait::setStatus in Acquia Purge 7

2 calls to AcquiaPurgeQueueStatusTrait::setStatus()
AcquiaPurgeQueueStatusTrait::setStatusFailed in lib/queue/AcquiaPurgeQueueStatusTrait.php
AcquiaPurgeQueueStatusTrait::setStatusSucceeded in lib/queue/AcquiaPurgeQueueStatusTrait.php
1 method overrides AcquiaPurgeQueueStatusTrait::setStatus()
AcquiaPurgeInvalidation::setStatus in lib/invalidation/AcquiaPurgeInvalidation.php
Set status on the queue item, in the invalidation-specific context.

File

lib/queue/AcquiaPurgeQueueStatusTrait.php, line 86

Class

AcquiaPurgeQueueStatusTrait
Provides methods capable of letting multiple actors set a SUCCEEDED or FAILED status, which can then be evaluated to a single overall outcome.

Code

public function setStatus($status) {
  if (is_null($this->context)) {
    throw new \LogicException('Status cannot be set in NULL context!');
  }
  if (!is_int($status)) {
    throw new RuntimeException('Status $status not an integer!');
  }
  if (!in_array($status, $this->statuses_after_processing)) {
    throw new RuntimeException('Status is not FAILED or SUCCEEDED!');
  }
  $this->statuses[$this->context] = $status;
}