Automattic\WooCommerce\Admin\API\Reports

DataStore::get_match_operator()protectedWC 1.0

Returns logic operator for WHERE subclause based on 'match' query argument.

Method of the class: DataStore{}

No Hooks.

Return

String.

Usage

// protected - for code of main (parent) or child class
$result = $this->get_match_operator( $query_args );
$query_args(array) (required)
Parameters supplied by the user.

DataStore::get_match_operator() code WC 8.6.1

protected function get_match_operator( $query_args ) {
	$operator = 'AND';

	if ( ! isset( $query_args['match'] ) ) {
		return $operator;
	}

	if ( 'all' === strtolower( $query_args['match'] ) ) {
		$operator = 'AND';
	} elseif ( 'any' === strtolower( $query_args['match'] ) ) {
		$operator = 'OR';
	}
	return $operator;
}