You are here

function rules_execute_condition in Rules 6

Execution handler for conditions Note: An condition may not alter arguments

Parameters

$element The condition's configuration element:

$state The current evaluation state:

Return value

The execution result of the condition, or if it is no valid condition FALSE.

1 string reference to 'rules_execute_condition'
rules_elements in rules/rules.module
Implementation of hook_elements() Defines default values for all available properties of rules's element types

File

rules/rules.module, line 482
Rules engine module

Code

function rules_execute_condition($element, &$state) {
  $exec_args = rules_get_execution_arguments($element, $state);
  if ($exec_args !== FALSE) {
    $result = rules_element_invoke($element, '', $exec_args);
    rules_log(t('Condition "@name" evaluated to @bool.', array(
      '@name' => rules_get_element_label($element),
      '@bool' => $result !== FALSE ? 'TRUE' : 'FALSE',
    )));
    return $result;
  }
  return FALSE;
}