You are here

public function RulesEventManager::getEventBaseName in Rules 8.3

Gets the base name of a configured event name.

For a configured event name like {EVENT_NAME}--{SUFFIX}, the base event name {EVENT_NAME} is returned.

Return value

string The event base name.

See also

\Drupal\rules\Core\RulesConfigurableEventHandlerInterface::getEventNameSuffix()

2 calls to RulesEventManager::getEventBaseName()
RulesEventManager::createInstance in src/Core/RulesEventManager.php
Creates a pre-configured instance of a plugin.
RulesEventManager::getDefinition in src/Core/RulesEventManager.php
Gets a specific plugin definition.

File

src/Core/RulesEventManager.php, line 112

Class

RulesEventManager
Plugin manager for Rules events that can be triggered.

Namespace

Drupal\rules\Core

Code

public function getEventBaseName($event_name) {

  // Cut off any suffix from a configured event name.
  if (strpos($event_name, '--') !== FALSE) {
    $parts = explode('--', $event_name, 2);
    return $parts[0];
  }
  return $event_name;
}