function RulesEventHandlerEntityBundle::availableVariables

Implements RulesEventHandlerInterface::availableVariables().

Overrides RulesEventHandlerBase::availableVariables

File

includes/rules.event.inc, line 408

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;
}