function VariableAdd::refineContextDefinitions

Overrides RulesActionBase::refineContextDefinitions

File

src/Plugin/RulesAction/VariableAdd.php, line 52

Class

VariableAdd
Provides an 'Add a variable' action.

Namespace

Drupal\rules\Plugin\RulesAction

Code

public function refineContextDefinitions(array $selected_data) {
    if ($type = $this->getContextValue('type')) {
        $this->pluginDefinition['context_definitions']['value']
            ->setDataType($type);
        $this->pluginDefinition['provides']['variable_added']
            ->setDataType($type);
    }
}