function DataComparison::refineContextDefinitions

Overrides RulesConditionBase::refineContextDefinitions

File

src/Plugin/Condition/DataComparison.php, line 87

Class

DataComparison
Provides a 'Data comparison' condition.

Namespace

Drupal\rules\Plugin\Condition

Code

public function refineContextDefinitions(array $selected_data) {
    if (isset($selected_data['data'])) {
        $this->pluginDefinition['context_definitions']['value']
            ->setDataType($selected_data['data']->getDataType());
        if ($this->getContextValue('operation') == 'IN') {
            $this->pluginDefinition['context_definitions']['value']
                ->setMultiple();
        }
    }
}