You are here

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

Gets the type of an event.

Parameters

string $event: The event descriptor.

Return value

string Event Type.

Overrides FloodUnblockManagerInterface::getEventType

1 call to FloodUnblockManager::getEventType()
FloodUnblockManager::isBlocked in src/FloodUnblockManager.php
Provides identifier's flood status.

File

src/FloodUnblockManager.php, line 180

Class

FloodUnblockManager
Provides Flood Unblock actions.

Namespace

Drupal\flood_control

Code

public function getEventType($event) {
  $event_mapping = $this
    ->getEvents();
  if (array_key_exists($event, $event_mapping)) {
    return $event_mapping[$event]['type'];
  }
  $parts = explode('.', $event);
  return $parts[0];
}