WordPress at a glance
function is not described

Automattic\WooCommerce\Admin\API\Reports\Coupons

DataStore::get_coupons() public WC 1.0

Gets coupons based on the provided arguments.

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

No Hooks.

Return

Array. Array of results.

Usage

$DataStore = new DataStore();
$DataStore->get_coupons( $args );
$args(array) (required)
Array of args to filter the query by. Supports include.

Code of DataStore::get_coupons() WC 5.3.0

<?php
public function get_coupons( $args ) {
	global $wpdb;
	$query = "SELECT ID, post_title FROM {$wpdb->posts} WHERE post_type='shop_coupon'";

	$included_coupons = $this->get_included_coupons( $args, 'include' );
	if ( ! empty( $included_coupons ) ) {
		$query .= " AND ID IN ({$included_coupons})";
	}

	return $wpdb->get_results( $query ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
}