You are here

public function AcquiaPurgeQueueStatusTrait::getStatus in Acquia Purge 7

1 call to AcquiaPurgeQueueStatusTrait::getStatus()
AcquiaPurgeQueueStatusTrait::setStatusContext in lib/queue/AcquiaPurgeQueueStatusTrait.php
1 method overrides AcquiaPurgeQueueStatusTrait::getStatus()
AcquiaPurgeInvalidation::getStatus in lib/invalidation/AcquiaPurgeInvalidation.php
Route any calls to the queue item's function so that a single queue item holds the overal statuses for all domain and scheme-varied copies of a single HTTP path.

File

lib/queue/AcquiaPurgeQueueStatusTrait.php, line 41

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 getStatus() {
  if (empty($this->statuses)) {
    return SELF::FRESH;
  }
  if ($this->context === NULL) {
    if (in_array(SELF::FAILED, $this->statuses)) {
      return SELF::FAILED;
    }
    return SELF::SUCCEEDED;
  }
  else {
    if (isset($this->statuses[$this->context])) {
      return $this->statuses[$this->context];
    }
    return SELF::FRESH;
  }
}