Automattic\WooCommerce\Admin\RemoteSpecs\RuleProcessors\Transformers

DotNotation::transform()publicWC 1.0

Find given path from the given value.

Method of the class: DotNotation{}

No Hooks.

Return

Mixed.

Usage

$DotNotation = new DotNotation();
$DotNotation->transform( $value, ?stdclass $arguments, $default_value );
$value(mixed) (required)
a value to transform.
?stdclass $arguments **
-
Default: null
$default_value(string|null)
default value.
Default: null

DotNotation::transform() code WC 9.7.1

public function transform( $value, ?stdclass $arguments = null, $default_value = null ) {
	if ( is_object( $value ) ) {
		// if the value is an object, convert it to an array.
		$value = json_decode( wp_json_encode( $value ), true );
	}

	return $this->get( $value, $arguments->path, $default_value );
}