Automattic\WooCommerce\Internal\Api

QueryComplexityRule::buildFieldArguments │ protected │ WC 1.0

Build the argument values handed to a field's complexity callback.

Same semantics as the stock rule, but variable values are coerced once per document (see {@see self::get_coerced_variable_values()}).

Method of the class: QueryComplexityRule{}

No Hooks.

Returns

array<string, mixed>. The coerced argument values.

Usage

// protected - for code of main (parent) or child class
$result = $this->buildFieldArguments( $node ): array;
$node(FieldNode) (required)
The field node.

QueryComplexityRule::buildFieldArguments() code WC 11.1.2

protected function buildFieldArguments( FieldNode $node ): array {
	$field_definition = $this->fieldDefinition( $node );

	return $field_definition instanceof FieldDefinition
		? Values::getArgumentValues( $field_definition, $node, $this->get_coerced_variable_values() )
		: array();
}