You are here

protected function RulesConditionalTestStubContainer::selectBranches in Conditional Rules 8

Same name and namespace in other branches
  1. 7 tests/rules_conditional_test.inc \RulesConditionalTestStubContainer::selectBranches()

Selects the branches to evaluate for this conditional.

Parameters

RulesState $state: Rules state to use.

Return value

RulesConditionalElement[] An array of branches to evaluate.

Overrides RulesConditionalContainer::selectBranches

File

tests/rules_conditional_test.inc, line 25
Testing implementations.

Class

RulesConditionalTestStubContainer
Test base conditional.

Code

protected function selectBranches(RulesState $state) {

  // Pick the first element to pass.
  foreach ($this->children as $element) {
    if ($element
      ->canEvaluate($state)) {
      return array(
        $element,
      );
    }
  }
  return array();
}