protected function RulesConditionalCase::setUpCondition in Conditional Rules 8
Same name and namespace in other branches
- 7 includes/rules_conditional.plugin.inc \RulesConditionalCase::setUpCondition()
1 call to RulesConditionalCase::setUpCondition()
File
- includes/
rules_conditional.plugin.inc, line 315 - Rules plugin implementation.
Class
- RulesConditionalCase
- Switch case.
Code
protected function setUpCondition() {
if (!isset($this->condition) && isset($this->parent)) {
// Prepare settings for 'data_is' condition.
$settings = array(
'data:select' => $this->parent->settings['data:select'],
'op' => '==',
);
if (isset($this->settings['value:select'])) {
$settings['value:select'] = $this->settings['value:select'];
}
elseif (isset($this->settings['value'])) {
$settings['value'] = $this->settings['value'];
}
else {
// Abort if settings are incomplete.
return;
}
// Set up 'data_is'.
$this->condition = rules_condition('data_is', $settings);
$this->condition->parent = $this;
$this->condition
->processSettings();
}
}