You are here

function rules_get_event_base_name in Rules 7.2

Returns the base name of a configured event name.

For a configured event name like node_view--article the base event name node_view is returned.

Parameters

string $event_name: A (configured) event name.

Return value

string The event base name.

3 calls to rules_get_event_base_name()
RulesEventSet::rebuildEventCache in includes/rules.plugins.inc
Rebuilds the event cache.
rules_get_event_handler in ./rules.module
Returns the rule event handler for the given event.
rules_get_event_info in ./rules.module
Gets event info for a given event.

File

./rules.module, line 656
Rules engine module.

Code

function rules_get_event_base_name($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;
}