WooCommerce Code Reference

OptionRuleProcessor
in package
implements RuleProcessorInterface

Rule processor that performs a comparison operation against an option value.

Interfaces, Classes and Traits

RuleProcessorInterface
Rule processor interface

Table of Contents

process()  : bool
Performs a comparison operation against the option value.
validate()  : bool
Validates the rule.
get_option_value()  : mixed
Retrieves the option value and handles logging if necessary.

Methods

process()

Performs a comparison operation against the option value.

public process(object $rule, object $stored_state) : bool
Parameters
$rule : object

The specific rule being processed by this rule processor.

$stored_state : object

Stored state.

Return values
boolThe result of the operation.

get_option_value()

Retrieves the option value and handles logging if necessary.

private get_option_value(object $rule, mixed $default_value, bool $is_contains) : mixed
Parameters
$rule : object

The specific rule being processed.

$default_value : mixed

The default value.

$is_contains : bool

Indicates whether the operation is "contains".

Return values
mixedThe option value.