OrExpression.php in Rules 8.3
File
src/Plugin/RulesExpression/OrExpression.php
View source
<?php
namespace Drupal\rules\Plugin\RulesExpression;
use Drupal\rules\Context\ExecutionStateInterface;
use Drupal\rules\Engine\ConditionExpressionContainer;
class OrExpression extends ConditionExpressionContainer {
public function evaluate(ExecutionStateInterface $state) {
foreach ($this as $condition) {
if ($condition
->executeWithState($state)) {
$this->rulesDebugLogger
->info('%label evaluated to %result.', [
'%label' => $this
->getLabel(),
'%result' => 'TRUE',
]);
return TRUE;
}
}
$this->rulesDebugLogger
->info('%label evaluated to %result.', [
'%label' => $this
->getLabel(),
'%result' => 'FALSE',
]);
return empty($this->conditions);
}
protected function allowsMetadataAssertions() {
return FALSE;
}
}
Classes
Name |
Description |
OrExpression |
Evaluates a group of conditions with a logical OR. |