You are here

public function FloodUnblockManager::getEventLabel in Flood control 2.0.x

Gets the label of an event.

Parameters

string $event: The event descriptor.

Return value

string Event Label.

Overrides FloodUnblockManagerInterface::getEventLabel

File

src/FloodUnblockManager.php, line 168

Class

FloodUnblockManager
Provides Flood Unblock actions.

Namespace

Drupal\flood_control

Code

public function getEventLabel($event) {
  $event_mapping = $this
    ->getEvents();
  if (array_key_exists($event, $event_mapping)) {
    return $event_mapping[$event]['label'];
  }
  return ucfirst(str_replace([
    '.',
    '_',
  ], ' ', $event));
}