Automattic\WooCommerce\Admin\API\Reports\Coupons\Stats

Controller::prepare_reports_query()protectedWC 1.0

Maps query arguments from the REST request.

Method of the class: Controller{}

No Hooks.

Return

Array.

Usage

// protected - for code of main (parent) or child class
$result = $this->prepare_reports_query( $request );
$request(array) (required)
Request array.

Controller::prepare_reports_query() code WC 7.3.0

protected function prepare_reports_query( $request ) {
	$args                        = array();
	$args['before']              = $request['before'];
	$args['after']               = $request['after'];
	$args['interval']            = $request['interval'];
	$args['page']                = $request['page'];
	$args['per_page']            = $request['per_page'];
	$args['orderby']             = $request['orderby'];
	$args['order']               = $request['order'];
	$args['coupons']             = (array) $request['coupons'];
	$args['segmentby']           = $request['segmentby'];
	$args['fields']              = $request['fields'];
	$args['force_cache_refresh'] = $request['force_cache_refresh'];

	return $args;
}