WordPress at a glance
function is not described

Automattic\WooCommerce\Admin\API\Reports\Orders

DataStore::get_coupons_by_order_ids() protected WC 1.0

Get coupon information from order IDs.

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

No Hooks.

Return

Array. Nothing.

Usage

// protected - for code of main (parent) or child class
$result = $this->get_coupons_by_order_ids( $order_ids );
$order_ids(array) (required)
Array of order IDs.

Code of DataStore::get_coupons_by_order_ids() WC 5.2.2

<?php
protected function get_coupons_by_order_ids( $order_ids ) {
	global $wpdb;
	$order_coupon_lookup_table = $wpdb->prefix . 'wc_order_coupon_lookup';
	$included_order_ids        = implode( ',', $order_ids );

	$coupons = $wpdb->get_results(
		"SELECT order_id, coupon_id, post_title as coupon_code
			FROM {$wpdb->posts}
			JOIN {$order_coupon_lookup_table} ON {$order_coupon_lookup_table}.coupon_id = {$wpdb->posts}.ID
			WHERE
				order_id IN ({$included_order_ids})
			",
		ARRAY_A
	); // WPCS: cache ok, DB call ok, unprepared SQL ok.

	return $coupons;
}