Automattic\WooCommerce\Internal\DataStores\Orders

OrdersTableFieldQuery::sanitize_relation()privateWC 1.0

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

Method of the class: OrdersTableFieldQuery{}

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.

OrdersTableFieldQuery::sanitize_relation() code WC 7.1.1

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

	return 'AND';
}