Automattic\WooCommerce\Admin\RemoteInboxNotifications

OrRuleProcessor::process()publicWC 1.0

Performs an OR operation on the rule's left and right operands.

Метод класса: OrRuleProcessor{}

No Hooks.

Return

true|false. The result of the operation.

Usage

$OrRuleProcessor = new OrRuleProcessor();
$OrRuleProcessor->process( $rule, $stored_state );
$rule(object) (required)
The specific rule being processed by this rule processor.
$stored_state(object) (required)
Stored state.

Code of OrRuleProcessor::process() WC 7.1.0

public function process( $rule, $stored_state ) {
	foreach ( $rule->operands as $operand ) {
		$evaluated_operand = $this->rule_evaluator->evaluate(
			$operand,
			$stored_state
		);

		if ( $evaluated_operand ) {
			return true;
		}
	}

	return false;
}