You are here

public function ImmutableInvalidationBase::getStateStringTranslated in Purge 8.3

Get the current state as user translated string.

Return value

\Drupal\Core\StringTranslation\TranslatableMarkup The translated string describing the current state of the invalidation.

Overrides ImmutableInvalidationInterface::getStateStringTranslated

File

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

Class

ImmutableInvalidationBase
Provides base implementations the immutable invalidation object.

Namespace

Drupal\purge\Plugin\Purge\Invalidation

Code

public function getStateStringTranslated() {
  $mapping = [
    self::FRESH => $this
      ->t('New'),
    self::PROCESSING => $this
      ->t('Currently invalidating'),
    self::SUCCEEDED => $this
      ->t('Succeeded'),
    self::FAILED => $this
      ->t('Failed'),
    self::NOT_SUPPORTED => $this
      ->t('Not supported'),
  ];
  return $mapping[$this
    ->getState()];
}