You are here

public function ImmutableInvalidationBase::getStateContexts in Purge 8.3

Get all stored state contexts.

Return value

string[] Non-associative list of stored state contexts.

Throws

\LogicException Thrown when NOT operating in general context.

Overrides ImmutableInvalidationInterface::getStateContexts

File

src/Plugin/Purge/Invalidation/ImmutableInvalidationBase.php, line 209

Class

ImmutableInvalidationBase
Provides base implementations the immutable invalidation object.

Namespace

Drupal\purge\Plugin\Purge\Invalidation

Code

public function getStateContexts() {
  if (!is_null($this->context)) {
    throw new \LogicException('Cannot retrieve state contexts in purger context.');
  }
  return array_keys($this->states);
}