Automattic\WooCommerce\Internal\DataStores\Orders

OrdersTableMetaQuery::sanitize_relation()privateWC 1.0

Makes sure we use an AND or OR relation. Defaults to AND.

{} It's a method of the class: OrdersTableMetaQuery{}

No Hooks.

Return

String.

Usage

// private - for code of main (parent) class only
$result = $this->sanitize_relation( $relation ): string;
$relation(string) (required)
An unsanitized relation prop.

Code of OrdersTableMetaQuery::sanitize_relation() WC 7.1.0

private function sanitize_relation( string $relation ): string {
	if ( ! empty( $relation ) && 'OR' === strtoupper( $relation ) ) {
		return 'OR';
	}

	return 'AND';
}