You are here

public function ImmutableInvalidationBase::getStateString in Purge 8.3

Get the current state as string.

Return value

string A capitalized string exactly matching the names of the constants in \Drupal\purge\Plugin\Purge\Invalidation\InvStatesInterface.

Overrides ImmutableInvalidationInterface::getStateString

1 method overrides ImmutableInvalidationBase::getStateString()
ImmutableInvalidation::getStateString in src/Plugin/Purge/Invalidation/ImmutableInvalidation.php
Get the current state as string.

File

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

Class

ImmutableInvalidationBase
Provides base implementations the immutable invalidation object.

Namespace

Drupal\purge\Plugin\Purge\Invalidation

Code

public function getStateString() {
  $mapping = [
    self::FRESH => 'FRESH',
    self::PROCESSING => 'PROCESSING',
    self::SUCCEEDED => 'SUCCEEDED',
    self::FAILED => 'FAILED',
    self::NOT_SUPPORTED => 'NOT_SUPPORTED',
  ];
  return $mapping[$this
    ->getState()];
}