You are here

public function RulesEventHandlerEntityBundle::availableVariables in Rules 7.2

Implements RulesEventHandlerInterface::availableVariables().

Overrides RulesEventHandlerBase::availableVariables

File

includes/rules.event.inc, line 408
Contains event handler interface and base classes.

Class

RulesEventHandlerEntityBundle
Exposes the bundle of an entity as event setting.

Code

public function availableVariables() {
  $variables = $this->eventInfo['variables'];
  if ($this->settings['bundle']) {

    // Add the bundle to all variables of the entity type.
    foreach ($variables as $name => $variable_info) {
      if ($variable_info['type'] == $this->entityType) {
        $variables[$name]['bundle'] = $this->settings['bundle'];
      }
    }
  }
  return $variables;
}