Automattic\WooCommerce\Admin\RemoteInboxNotifications

StoredStateRuleProcessor::process()publicWC 1.0

Performs a comparison operation against a value in the stored state object.

Method of the class: StoredStateRuleProcessor{}

No Hooks.

Return

true|false. The result of the operation.

Usage

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

StoredStateRuleProcessor::process() code WC 8.7.0

public function process( $rule, $stored_state ) {
	if ( ! isset( $stored_state->{$rule->index} ) ) {
		return false;
	}

	return ComparisonOperation::compare(
		$stored_state->{$rule->index},
		$rule->value,
		$rule->operation
	);
}