PluginProbe
WooCommerce / 11.1.0
WooCommerce v11.1.0
11.1.0 11.1.0-rc.2 11.1.0-rc.1 11.1.0-beta.2 11.1.0-beta.1 11.0.1 11.0.0 11.0.0-rc.3 11.0.0-rc.2 11.0.0-rc.1 11.0.0-beta.2 11.0.0-beta.1 10.9.4 10.9.3 10.9.2 10.9.1 10.9.0 10.9.0-rc.1 10.9.0-beta.2 10.9.0-beta.1 10.8.1 10.8.0 10.8.0-rc.1 10.8.0-beta.2 10.8.0-beta.1 All 648 releases
woocommerce / src / Admin / API / Reports / Coupons / Stats / Query.php
Query.php
60 lines 1.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Class for parameter-based Products Report querying
4 *
5 * Example usage:
6 * $args = array(
7 * 'before' => '2018-07-19 00:00:00',
8 * 'after' => '2018-07-05 00:00:00',
9 * 'page' => 2,
10 * 'coupons' => array(5, 120),
11 * );
12 * $report = new \Automattic\WooCommerce\Admin\API\Reports\Coupons\Stats\Query( $args );
13 * $mydata = $report->get_data();
14 */
15
16 namespace Automattic\WooCommerce\Admin\API\Reports\Coupons\Stats;
17
18 defined( 'ABSPATH' ) || exit;
19
20 use Automattic\WooCommerce\Admin\API\Reports\Query as ReportsQuery;
21
22 /**
23 * API\Reports\Coupons\Stats\Query
24 *
25 * @deprecated 9.3.0 Coupons\Stats\Query class is deprecated. Please use `GenericQuery`, \WC_Object_Query`, or use `DataStore` directly.
26 */
27 class Query extends ReportsQuery {
28
29 /**
30 * Valid fields for Products report.
31 *
32 * @deprecated 9.3.0 Coupons\Stats\Query class is deprecated. Please use `GenericQuery`, \WC_Object_Query`, or use `DataStore` directly.
33 *
34 * @return array
35 */
36 protected function get_default_query_vars() {
37 wc_deprecated_function( __CLASS__ . '::' . __FUNCTION__, '9.3.0', '`GenericQuery`, `\WC_Object_Query`, or direct `DataStore` use' );
38
39 return array();
40 }
41
42 /**
43 * Get product data based on the current query vars.
44 *
45 * @deprecated 9.3.0 Coupons\Stats\Query class is deprecated. Please use `GenericQuery`, \WC_Object_Query`, or use `DataStore` directly.
46 *
47 * @return array
48 */
49 public function get_data() {
50 wc_deprecated_function( __CLASS__ . '::' . __FUNCTION__, '9.3.0', '`GenericQuery`, `\WC_Object_Query`, or direct `DataStore` use' );
51
52 $args = apply_filters( 'woocommerce_analytics_coupons_stats_query_args', $this->get_query_vars() );
53
54 $data_store = \WC_Data_Store::load( 'report-coupons-stats' );
55 $results = $data_store->get_data( $args );
56 return apply_filters( 'woocommerce_analytics_coupons_select_query', $results, $args );
57 }
58
59 }
60