You are here

public static function AlertStyleProvider::alertStyleName in Sitewide Alert 8

Given a class get the alert style name.

Parameters

string $class: Class name to look up.

Return value

\Drupal\Core\StringTranslation\TranslatableMarkup Renderable label for class.

1 call to AlertStyleProvider::alertStyleName()
SitewideAlertListBuilder::buildRow in src/SitewideAlertListBuilder.php
Builds a row for an entity in the entity listing.

File

src/AlertStyleProvider.php, line 50

Class

AlertStyleProvider
Class AlertStyleProvider.

Namespace

Drupal\sitewide_alert

Code

public static function alertStyleName(string $class) {
  $alertStyle = self::alertStyles();
  if (isset($alertStyle[$class])) {
    return new TranslatableMarkup($alertStyle[$class]);
  }
  return new TranslatableMarkup('N/A');
}