You are here

public function RulesConditionBase::evaluate in Rules 8.3

Evaluates the condition and returns TRUE or FALSE accordingly.

Return value

bool TRUE if the condition has been met, FALSE otherwise.

Overrides ConditionInterface::evaluate

5 methods override RulesConditionBase::evaluate()
DataIsEmpty::evaluate in src/Plugin/Condition/DataIsEmpty.php
Evaluates the condition and returns TRUE or FALSE accordingly.
TestConditionFalse::evaluate in tests/modules/rules_test/src/Plugin/Condition/TestConditionFalse.php
Evaluates the condition and returns TRUE or FALSE accordingly.
TestConditionProvider::evaluate in tests/modules/rules_test/src/Plugin/Condition/TestConditionProvider.php
Evaluates the condition and returns TRUE or FALSE accordingly.
TestConditionTrue::evaluate in tests/modules/rules_test/src/Plugin/Condition/TestConditionTrue.php
Evaluates the condition and returns TRUE or FALSE accordingly.
TestTextCondition::evaluate in tests/modules/rules_test/src/Plugin/Condition/TestTextCondition.php
Evaluates the condition and returns TRUE or FALSE accordingly.

File

src/Core/RulesConditionBase.php, line 63

Class

RulesConditionBase
Base class for rules conditions.

Namespace

Drupal\rules\Core

Code

public function evaluate() {

  // Provide a reasonable default implementation that calls doEvaluate() while
  // passing the defined context as arguments.
  $args = [];
  foreach ($this
    ->getContextDefinitions() as $name => $definition) {
    $args[$name] = $this
      ->getContextValue($name);
  }
  return call_user_func_array([
    $this,
    'doEvaluate',
  ], $args);
}