Log deprecation warnings for Query class (#50969)
Log deprecation warnings for analytic reports `Automattic\WooCommerce\Admin\API\Reports\Query` class usage. Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
parent
bd9716a33e
commit
deb76cbada
|
@ -0,0 +1,4 @@
|
|||
Significance: patch
|
||||
Type: tweak
|
||||
|
||||
Log deprecation warnings for `Query` class usage.
|
|
@ -32,7 +32,7 @@ class Controller extends GenericController implements ExportableInterface {
|
|||
protected $rest_base = 'reports/categories';
|
||||
|
||||
/**
|
||||
* Get data from `'categories'` Query.
|
||||
* Get data from `'categories'` GenericQuery.
|
||||
*
|
||||
* @override GenericController::get_datastore_data()
|
||||
*
|
||||
|
|
|
@ -23,7 +23,7 @@ use Automattic\WooCommerce\Admin\API\Reports\Query as ReportsQuery;
|
|||
/**
|
||||
* API\Reports\Categories\Query
|
||||
*
|
||||
* @deprecated 9.3.0 Categories\Query class is deprecated, please use GenericQuery or \WC_Object_Query instead.
|
||||
* @deprecated 9.3.0 Categories\Query class is deprecated. Please use `GenericQuery`, \WC_Object_Query`, or use `DataStore` directly.
|
||||
*/
|
||||
class Query extends ReportsQuery {
|
||||
|
||||
|
@ -32,22 +32,26 @@ class Query extends ReportsQuery {
|
|||
/**
|
||||
* Valid fields for Categories report.
|
||||
*
|
||||
* @deprecated 9.3.0 Categories\Query class is deprecated, please use GenericQuery or \WC_Object_Query instead.
|
||||
* @deprecated 9.3.0 Categories\Query class is deprecated. Please use `GenericQuery`, \WC_Object_Query`, or use `DataStore` directly.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function get_default_query_vars() {
|
||||
wc_deprecated_function( __CLASS__ . '::' . __FUNCTION__, '9.3.0', '`GenericQuery`, `\WC_Object_Query`, or direct `DataStore` use' );
|
||||
|
||||
return array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get categories data based on the current query vars.
|
||||
*
|
||||
* @deprecated 9.3.0 Categories\Query class is deprecated, please use GenericQuery or \WC_Object_Query instead.
|
||||
* @deprecated 9.3.0 Categories\Query class is deprecated. Please use `GenericQuery`, \WC_Object_Query`, or use `DataStore` directly.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function get_data() {
|
||||
wc_deprecated_function( __CLASS__ . '::' . __FUNCTION__, '9.3.0', '`GenericQuery`, `\WC_Object_Query`, or direct `DataStore` use' );
|
||||
|
||||
$args = apply_filters( 'woocommerce_analytics_categories_query_args', $this->get_query_vars() );
|
||||
$results = \WC_Data_Store::load( self::REPORT_NAME )->get_data( $args );
|
||||
return apply_filters( 'woocommerce_analytics_categories_select_query', $results, $args );
|
||||
|
|
|
@ -31,7 +31,7 @@ class Controller extends GenericController implements ExportableInterface {
|
|||
protected $rest_base = 'reports/coupons';
|
||||
|
||||
/**
|
||||
* Get data from `'coupons'` Query.
|
||||
* Get data from `'coupons'` GenericQuery.
|
||||
*
|
||||
* @override GenericController::get_datastore_data()
|
||||
*
|
||||
|
|
|
@ -22,29 +22,33 @@ use Automattic\WooCommerce\Admin\API\Reports\Query as ReportsQuery;
|
|||
/**
|
||||
* API\Reports\Coupons\Query
|
||||
*
|
||||
* @deprecated 9.3.0 Coupons\Query class is deprecated, please use GenericQuery or \WC_Object_Query instead.
|
||||
* @deprecated 9.3.0 Coupons\Query class is deprecated. Please use `GenericQuery`, \WC_Object_Query`, or use `DataStore` directly.
|
||||
*/
|
||||
class Query extends ReportsQuery {
|
||||
|
||||
/**
|
||||
* Valid fields for Products report.
|
||||
*
|
||||
* @deprecated 9.3.0 Coupons\Query class is deprecated, please use GenericQuery or \WC_Object_Query instead.
|
||||
* @deprecated 9.3.0 Coupons\Query class is deprecated. Please use `GenericQuery`, \WC_Object_Query`, or use `DataStore` directly.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function get_default_query_vars() {
|
||||
wc_deprecated_function( __CLASS__ . '::' . __FUNCTION__, '9.3.0', '`GenericQuery`, `\WC_Object_Query`, or direct `DataStore` use' );
|
||||
|
||||
return array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get product data based on the current query vars.
|
||||
*
|
||||
* @deprecated 9.3.0 Coupons\Query class is deprecated, please use GenericQuery or \WC_Object_Query instead.
|
||||
* @deprecated 9.3.0 Coupons\Query class is deprecated. Please use `GenericQuery`, \WC_Object_Query`, or use `DataStore` directly.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function get_data() {
|
||||
wc_deprecated_function( __CLASS__ . '::' . __FUNCTION__, '9.3.0', '`GenericQuery`, `\WC_Object_Query`, or direct `DataStore` use' );
|
||||
|
||||
$args = apply_filters( 'woocommerce_analytics_coupons_query_args', $this->get_query_vars() );
|
||||
|
||||
$data_store = \WC_Data_Store::load( 'report-coupons' );
|
||||
|
|
|
@ -54,7 +54,7 @@ class Controller extends GenericStatsController {
|
|||
}
|
||||
|
||||
/**
|
||||
* Get data from `'coupons-stats'` Query.
|
||||
* Get data from `'coupons-stats'` GenericQuery.
|
||||
*
|
||||
* @override GenericController::get_datastore_data()
|
||||
*
|
||||
|
|
|
@ -22,29 +22,33 @@ use Automattic\WooCommerce\Admin\API\Reports\Query as ReportsQuery;
|
|||
/**
|
||||
* API\Reports\Coupons\Stats\Query
|
||||
*
|
||||
* @deprecated 9.3.0 Coupons\Stats\Query class is deprecated, please use GenericQuery or \WC_Object_Query instead.
|
||||
* @deprecated 9.3.0 Coupons\Stats\Query class is deprecated. Please use `GenericQuery`, \WC_Object_Query`, or use `DataStore` directly.
|
||||
*/
|
||||
class Query extends ReportsQuery {
|
||||
|
||||
/**
|
||||
* Valid fields for Products report.
|
||||
*
|
||||
* @deprecated 9.3.0 Coupons\Stats\Query class is deprecated, please use GenericQuery or \WC_Object_Query instead.
|
||||
* @deprecated 9.3.0 Coupons\Stats\Query class is deprecated. Please use `GenericQuery`, \WC_Object_Query`, or use `DataStore` directly.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function get_default_query_vars() {
|
||||
wc_deprecated_function( __CLASS__ . '::' . __FUNCTION__, '9.3.0', '`GenericQuery`, `\WC_Object_Query`, or direct `DataStore` use' );
|
||||
|
||||
return array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get product data based on the current query vars.
|
||||
*
|
||||
* @deprecated 9.3.0 Coupons\Stats\Query class is deprecated, please use GenericQuery or \WC_Object_Query instead.
|
||||
* @deprecated 9.3.0 Coupons\Stats\Query class is deprecated. Please use `GenericQuery`, \WC_Object_Query`, or use `DataStore` directly.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function get_data() {
|
||||
wc_deprecated_function( __CLASS__ . '::' . __FUNCTION__, '9.3.0', '`GenericQuery`, `\WC_Object_Query`, or direct `DataStore` use' );
|
||||
|
||||
$args = apply_filters( 'woocommerce_analytics_coupons_stats_query_args', $this->get_query_vars() );
|
||||
|
||||
$data_store = \WC_Data_Store::load( 'report-coupons-stats' );
|
||||
|
|
|
@ -34,7 +34,7 @@ class Controller extends GenericController implements ExportableInterface {
|
|||
protected $rest_base = 'reports/customers';
|
||||
|
||||
/**
|
||||
* Get data from Query.
|
||||
* Get data from Customers\Query.
|
||||
*
|
||||
* @override GenericController::get_datastore_data()
|
||||
*
|
||||
|
|
|
@ -23,18 +23,20 @@ use Automattic\WooCommerce\Admin\API\Reports\Query as ReportsQuery;
|
|||
/**
|
||||
* API\Reports\Customers\Stats\Query
|
||||
*
|
||||
* @deprecated 9.3.0 Customers\Stats\Query class is deprecated, please use Reports\Customers\Query with a custom name, GenericQuery or \WC_Object_Query instead.
|
||||
* @deprecated 9.3.0 Customers\Stats\Query class is deprecated, please use `Reports\Customers\Query` with a custom name, `GenericQuery`, `\WC_Object_Query`, or use `DataStore` directly.
|
||||
*/
|
||||
class Query extends ReportsQuery {
|
||||
|
||||
/**
|
||||
* Valid fields for Customers report.
|
||||
*
|
||||
* @deprecated 9.3.0 Customers\Stats\Query class is deprecated, please use Reports\Customers\Query with a custom name, GenericQuery or \WC_Object_Query instead.
|
||||
* @deprecated 9.3.0 Customers\Stats\Query class is deprecated, please use `Reports\Customers\Query` with a custom name, `GenericQuery`, `\WC_Object_Query`, or use `DataStore` directly.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function get_default_query_vars() {
|
||||
wc_deprecated_function( __CLASS__ . '::' . __FUNCTION__, '9.3.0', '`Reports\Customers\Query` with a custom name, `GenericQuery`, `\WC_Object_Query`, or direct `DataStore` use' );
|
||||
|
||||
return array(
|
||||
'per_page' => get_option( 'posts_per_page' ), // not sure if this should be the default.
|
||||
'page' => 1,
|
||||
|
@ -47,11 +49,13 @@ class Query extends ReportsQuery {
|
|||
/**
|
||||
* Get product data based on the current query vars.
|
||||
*
|
||||
* @deprecated 9.3.0 Customers\Stats\Query class is deprecated, please use Reports\Customers\Query with a custom name, GenericQuery or \WC_Object_Query instead.
|
||||
* @deprecated 9.3.0 Customers\Stats\Query class is deprecated, please use `Reports\Customers\Query` with a custom name, `GenericQuery`, `\WC_Object_Query`, or use `DataStore` directly.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function get_data() {
|
||||
wc_deprecated_function( __CLASS__ . '::' . __FUNCTION__, 'x.x.x', '`Reports\Customers\Query` with a custom name, `GenericQuery`, `\WC_Object_Query`, or direct `DataStore` use' );
|
||||
|
||||
$args = apply_filters( 'woocommerce_analytics_customers_stats_query_args', $this->get_query_vars() );
|
||||
|
||||
$data_store = \WC_Data_Store::load( 'report-customers-stats' );
|
||||
|
|
|
@ -32,7 +32,7 @@ class Controller extends GenericController implements ExportableInterface {
|
|||
protected $rest_base = 'reports/downloads';
|
||||
|
||||
/**
|
||||
* Get data from `'downloads'` Query.
|
||||
* Get data from `'downloads'` GenericQuery.
|
||||
*
|
||||
* @override GenericController::get_datastore_data()
|
||||
*
|
||||
|
|
|
@ -22,29 +22,33 @@ use Automattic\WooCommerce\Admin\API\Reports\Query as ReportsQuery;
|
|||
/**
|
||||
* API\Reports\Downloads\Query
|
||||
*
|
||||
* @deprecated 9.3.0 Downloads\Query class is deprecated, please use GenericQuery or \WC_Object_Query instead.
|
||||
* @deprecated 9.3.0 Downloads\Query class is deprecated. Please use `GenericQuery`, \WC_Object_Query`, or use `DataStore` directly.
|
||||
*/
|
||||
class Query extends ReportsQuery {
|
||||
|
||||
/**
|
||||
* Valid fields for downloads report.
|
||||
*
|
||||
* @deprecated 9.3.0 Downloads\Query class is deprecated, please use GenericQuery or \WC_Object_Query instead.
|
||||
* @deprecated 9.3.0 Downloads\Query class is deprecated. Please use `GenericQuery`, \WC_Object_Query`, or use `DataStore` directly.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function get_default_query_vars() {
|
||||
wc_deprecated_function( __CLASS__ . '::' . __FUNCTION__, '9.3.0', '`GenericQuery`, `\WC_Object_Query`, or direct `DataStore` use' );
|
||||
|
||||
return array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get downloads data based on the current query vars.
|
||||
*
|
||||
* @deprecated 9.3.0 Downloads\Query class is deprecated, please use GenericQuery or \WC_Object_Query instead.
|
||||
* @deprecated 9.3.0 Downloads\Query class is deprecated. Please use `GenericQuery`, \WC_Object_Query`, or use `DataStore` directly.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function get_data() {
|
||||
wc_deprecated_function( __CLASS__ . '::' . __FUNCTION__, '9.3.0', '`GenericQuery`, `\WC_Object_Query`, or direct `DataStore` use' );
|
||||
|
||||
$args = apply_filters( 'woocommerce_analytics_downloads_query_args', $this->get_query_vars() );
|
||||
|
||||
$data_store = \WC_Data_Store::load( 'report-downloads' );
|
||||
|
|
|
@ -60,7 +60,7 @@ class Controller extends GenericStatsController {
|
|||
}
|
||||
|
||||
/**
|
||||
* Get data from `'downloads-stats'` Query.
|
||||
* Get data from `'downloads-stats'` GenericQuery.
|
||||
*
|
||||
* @override GenericController::get_datastore_data()
|
||||
*
|
||||
|
|
|
@ -12,29 +12,33 @@ use Automattic\WooCommerce\Admin\API\Reports\Query as ReportsQuery;
|
|||
/**
|
||||
* API\Reports\Downloads\Stats\Query
|
||||
*
|
||||
* @deprecated 9.3.0 Downloads\Stats\Query class is deprecated, please use GenericQuery or \WC_Object_Query instead.
|
||||
* @deprecated 9.3.0 Downloads\Stats\Query class is deprecated. Please use `GenericQuery`, \WC_Object_Query`, or use `DataStore` directly.
|
||||
*/
|
||||
class Query extends ReportsQuery {
|
||||
|
||||
/**
|
||||
* Valid fields for Orders report.
|
||||
*
|
||||
* @deprecated 9.3.0 Downloads\Stats\Query class is deprecated, please use GenericQuery or \WC_Object_Query instead.
|
||||
* @deprecated 9.3.0 Downloads\Stats\Query class is deprecated. Please use `GenericQuery`, \WC_Object_Query`, or use `DataStore` directly.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function get_default_query_vars() {
|
||||
wc_deprecated_function( __CLASS__ . '::' . __FUNCTION__, '9.3.0', '`GenericQuery`, `\WC_Object_Query`, or direct `DataStore` use' );
|
||||
|
||||
return array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get revenue data based on the current query vars.
|
||||
*
|
||||
* @deprecated 9.3.0 Downloads\Stats\Query class is deprecated, please use GenericQuery or \WC_Object_Query instead.
|
||||
* @deprecated 9.3.0 Downloads\Stats\Query class is deprecated. Please use `GenericQuery`, \WC_Object_Query`, or use `DataStore` directly.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function get_data() {
|
||||
wc_deprecated_function( __CLASS__ . '::' . __FUNCTION__, '9.3.0', '`GenericQuery`, `\WC_Object_Query`, or direct `DataStore` use' );
|
||||
|
||||
$args = apply_filters( 'woocommerce_analytics_downloads_stats_query_args', $this->get_query_vars() );
|
||||
|
||||
$data_store = \WC_Data_Store::load( 'report-downloads-stats' );
|
||||
|
|
|
@ -175,7 +175,7 @@ abstract class GenericController extends \WC_REST_Reports_Controller {
|
|||
/**
|
||||
* Get the report data.
|
||||
*
|
||||
* Prepares query params, fetches the report data from the Query object,
|
||||
* Prepares query params, fetches the report data from the data store,
|
||||
* prepares it for the response, and packs it into the convention-conforming response object.
|
||||
*
|
||||
* @throws \WP_Error When the queried data is invalid.
|
||||
|
@ -237,7 +237,7 @@ abstract class GenericController extends \WC_REST_Reports_Controller {
|
|||
}
|
||||
|
||||
/**
|
||||
* Maps query arguments from the REST request, to be fed to Query.
|
||||
* Maps query arguments from the REST request, to be used to query the datastore.
|
||||
*
|
||||
* `WP_REST_Request` does not expose a method to return all params covering defaults,
|
||||
* as it does for `$request['param']` accessor.
|
||||
|
|
|
@ -207,7 +207,7 @@ abstract class GenericStatsController extends GenericController {
|
|||
/**
|
||||
* Get the report data.
|
||||
*
|
||||
* Prepares query params, fetches the report data from the Query object,
|
||||
* Prepares query params, fetches the report data from the data store,
|
||||
* prepares it for the response, and packs it into the convention-conforming response object.
|
||||
*
|
||||
* @override GenericController::get_items()
|
||||
|
|
|
@ -31,7 +31,7 @@ class Controller extends GenericController implements ExportableInterface {
|
|||
protected $rest_base = 'reports/orders';
|
||||
|
||||
/**
|
||||
* Get data from Query.
|
||||
* Get data from Orders\Query.
|
||||
*
|
||||
* @override GenericController::get_datastore_data()
|
||||
*
|
||||
|
|
|
@ -31,7 +31,7 @@ class Controller extends GenericStatsController {
|
|||
protected $rest_base = 'reports/orders/stats';
|
||||
|
||||
/**
|
||||
* Get data from Query.
|
||||
* Get data from Orders\Stats\Query.
|
||||
*
|
||||
* @override GenericController::get_datastore_data()
|
||||
*
|
||||
|
|
|
@ -478,7 +478,7 @@ class Controller extends GenericController {
|
|||
/**
|
||||
* Prepare links for the request.
|
||||
*
|
||||
* @param \Automattic\WooCommerce\Admin\API\Reports\Query $object Object data.
|
||||
* @param object $object data.
|
||||
* @return array
|
||||
*/
|
||||
protected function prepare_links( $object ) {
|
||||
|
|
|
@ -42,7 +42,7 @@ class Controller extends GenericController implements ExportableInterface {
|
|||
);
|
||||
|
||||
/**
|
||||
* Get data from `'products'` Query.
|
||||
* Get data from `'products'` GenericQuery.
|
||||
*
|
||||
* @override GenericController::get_datastore_data()
|
||||
*
|
||||
|
|
|
@ -23,29 +23,33 @@ use Automattic\WooCommerce\Admin\API\Reports\Query as ReportsQuery;
|
|||
/**
|
||||
* API\Reports\Products\Query
|
||||
*
|
||||
* @deprecated 9.3.0 Products\Query class is deprecated, please use GenericQuery or \WC_Object_Query instead.
|
||||
* @deprecated 9.3.0 Products\Query class is deprecated. Please use `GenericQuery`, \WC_Object_Query`, or use `DataStore` directly.
|
||||
*/
|
||||
class Query extends ReportsQuery {
|
||||
|
||||
/**
|
||||
* Valid fields for Products report.
|
||||
*
|
||||
* @deprecated 9.3.0 Products\Query class is deprecated, please use GenericQuery or \WC_Object_Query instead.
|
||||
* @deprecated 9.3.0 Products\Query class is deprecated. Please use `GenericQuery`, \WC_Object_Query`, or use `DataStore` directly.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function get_default_query_vars() {
|
||||
wc_deprecated_function( __CLASS__ . '::' . __FUNCTION__, '9.3.0', '`GenericQuery`, `\WC_Object_Query`, or direct `DataStore` use' );
|
||||
|
||||
return array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get product data based on the current query vars.
|
||||
*
|
||||
* @deprecated 9.3.0 Products\Query class is deprecated, please use GenericQuery or \WC_Object_Query instead.
|
||||
* @deprecated 9.3.0 Products\Query class is deprecated. Please use `GenericQuery`, \WC_Object_Query`, or use `DataStore` directly.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function get_data() {
|
||||
wc_deprecated_function( __CLASS__ . '::' . __FUNCTION__, '9.3.0', '`GenericQuery`, `\WC_Object_Query`, or direct `DataStore` use' );
|
||||
|
||||
$args = apply_filters( 'woocommerce_analytics_products_query_args', $this->get_query_vars() );
|
||||
|
||||
$data_store = \WC_Data_Store::load( 'report-products' );
|
||||
|
|
|
@ -48,7 +48,7 @@ class Controller extends GenericStatsController {
|
|||
}
|
||||
|
||||
/**
|
||||
* Get data from `'products-stats'` Query.
|
||||
* Get data from `'products-stats'` GenericQuery.
|
||||
*
|
||||
* @override GenericController::get_datastore_data()
|
||||
*
|
||||
|
@ -61,7 +61,7 @@ class Controller extends GenericStatsController {
|
|||
}
|
||||
|
||||
/**
|
||||
* Maps query arguments from the REST request, to be fed to Query.
|
||||
* Maps query arguments from the REST request to be used to query the datastore.
|
||||
*
|
||||
* @param \WP_REST_Request $request Full request object.
|
||||
* @return array Simplified array of params.
|
||||
|
|
|
@ -23,29 +23,33 @@ use Automattic\WooCommerce\Admin\API\Reports\Query as ReportsQuery;
|
|||
/**
|
||||
* API\Reports\Products\Stats\Query
|
||||
*
|
||||
* @deprecated 9.3.0 Products\Stats\Query class is deprecated, please use GenericQuery or \WC_Object_Query instead.
|
||||
* @deprecated 9.3.0 Products\Stats\Query class is deprecated. Please use `GenericQuery`, \WC_Object_Query`, or use `DataStore` directly.
|
||||
*/
|
||||
class Query extends ReportsQuery {
|
||||
|
||||
/**
|
||||
* Valid fields for Products report.
|
||||
*
|
||||
* @deprecated 9.3.0 Products\Stats\Query class is deprecated, please use GenericQuery or \WC_Object_Query instead.
|
||||
* @deprecated 9.3.0 Products\Stats\Query class is deprecated. Please use `GenericQuery`, \WC_Object_Query`, or use `DataStore` directly.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function get_default_query_vars() {
|
||||
wc_deprecated_function( __CLASS__ . '::' . __FUNCTION__, '9.3.0', '`GenericQuery`, `\WC_Object_Query`, or direct `DataStore` use' );
|
||||
|
||||
return array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get product data based on the current query vars.
|
||||
*
|
||||
* @deprecated 9.3.0 Products\Stats\Query class is deprecated, please use GenericQuery or \WC_Object_Query instead.
|
||||
* @deprecated 9.3.0 Products\Stats\Query class is deprecated. Please use `GenericQuery`, \WC_Object_Query`, or use `DataStore` directly.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function get_data() {
|
||||
wc_deprecated_function( __CLASS__ . '::' . __FUNCTION__, '9.3.0', '`GenericQuery`, `\WC_Object_Query`, or direct `DataStore` use' );
|
||||
|
||||
$args = apply_filters( 'woocommerce_analytics_products_stats_query_args', $this->get_query_vars() );
|
||||
|
||||
$data_store = \WC_Data_Store::load( 'report-products-stats' );
|
||||
|
|
|
@ -10,17 +10,31 @@ defined( 'ABSPATH' ) || exit;
|
|||
/**
|
||||
* Admin\API\Reports\Query
|
||||
*
|
||||
* @deprecated 9.3.0 Query class is deprecated, please use GenericQuery or \WC_Object_Query instead.
|
||||
* @deprecated 9.3.0 Query class is deprecated. Please use `GenericQuery`, \WC_Object_Query`, or use `DataStore` directly.
|
||||
*/
|
||||
abstract class Query extends \WC_Object_Query {
|
||||
|
||||
/**
|
||||
* Create a new query.
|
||||
*
|
||||
* @deprecated 9.3.0 Query class is deprecated. Please use `GenericQuery`, \WC_Object_Query`, or use `DataStore` directly.
|
||||
*
|
||||
* @param array $args Criteria to query on in a format similar to WP_Query.
|
||||
*/
|
||||
public function __construct( $args = array() ) {
|
||||
wc_deprecated_function( __CLASS__ . '::' . __FUNCTION__, '9.3.0', '`GenericQuery`, `\WC_Object_Query`, or direct `DataStore` use' );
|
||||
parent::__construct( $args );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get report data matching the current query vars.
|
||||
*
|
||||
* @deprecated 9.3.0 Query class is deprecated, please use GenericQuery or \WC_Object_Query instead.
|
||||
* @deprecated 9.3.0 Query class is deprecated. Please use `GenericQuery`, \WC_Object_Query`, or use `DataStore` directly.
|
||||
*
|
||||
* @return array|object of WC_Product objects
|
||||
*/
|
||||
public function get_data() {
|
||||
wc_deprecated_function( __CLASS__ . '::' . __FUNCTION__, '9.3.0', '`GenericQuery`, `\WC_Object_Query`, or direct `DataStore` use' );
|
||||
/* translators: %s: Method name */
|
||||
return new \WP_Error( 'invalid-method', sprintf( __( "Method '%s' not implemented. Must be overridden in subclass.", 'woocommerce' ), __METHOD__ ), array( 'status' => 405 ) );
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@ class Controller extends GenericController implements ExportableInterface {
|
|||
protected $rest_base = 'reports/taxes';
|
||||
|
||||
/**
|
||||
* Get data from `'taxes'` Query.
|
||||
* Get data from `'taxes'` GenericQuery.
|
||||
*
|
||||
* @override GenericController::get_datastore_data()
|
||||
*
|
||||
|
|
|
@ -22,29 +22,33 @@ use Automattic\WooCommerce\Admin\API\Reports\Query as ReportsQuery;
|
|||
/**
|
||||
* API\Reports\Taxes\Query
|
||||
*
|
||||
* @deprecated 9.3.0 Taxes\Query class is deprecated, please use GenericQuery or \WC_Object_Query instead.
|
||||
* @deprecated 9.3.0 Taxes\Query class is deprecated. Please use `GenericQuery`, \WC_Object_Query`, or use `DataStore` directly.
|
||||
*/
|
||||
class Query extends ReportsQuery {
|
||||
|
||||
/**
|
||||
* Valid fields for Taxes report.
|
||||
*
|
||||
* @deprecated 9.3.0 Taxes\Query class is deprecated, please use GenericQuery or \WC_Object_Query instead.
|
||||
* @deprecated 9.3.0 Taxes\Query class is deprecated. Please use `GenericQuery`, \WC_Object_Query`, or use `DataStore` directly.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function get_default_query_vars() {
|
||||
wc_deprecated_function( __CLASS__ . '::' . __FUNCTION__, '9.3.0', '`GenericQuery`, `\WC_Object_Query`, or direct `DataStore` use' );
|
||||
|
||||
return array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get product data based on the current query vars.
|
||||
*
|
||||
* @deprecated 9.3.0 Taxes\Query class is deprecated, please use GenericQuery or \WC_Object_Query instead.
|
||||
* @deprecated 9.3.0 Taxes\Query class is deprecated. Please use `GenericQuery`, \WC_Object_Query`, or use `DataStore` directly.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function get_data() {
|
||||
wc_deprecated_function( __CLASS__ . '::' . __FUNCTION__, '9.3.0', '`GenericQuery`, `\WC_Object_Query`, or direct `DataStore` use' );
|
||||
|
||||
$args = apply_filters( 'woocommerce_analytics_taxes_query_args', $this->get_query_vars() );
|
||||
|
||||
$data_store = \WC_Data_Store::load( 'report-taxes' );
|
||||
|
|
|
@ -84,7 +84,7 @@ class Controller extends GenericStatsController {
|
|||
}
|
||||
|
||||
/**
|
||||
* Get data from `'taxes-stats'` Query.
|
||||
* Get data from `'taxes-stats'` GenericQuery.
|
||||
*
|
||||
* @override GenericController::get_datastore_data()
|
||||
*
|
||||
|
|
|
@ -23,29 +23,33 @@ use Automattic\WooCommerce\Admin\API\Reports\Query as ReportsQuery;
|
|||
/**
|
||||
* API\Reports\Taxes\Stats\Query
|
||||
*
|
||||
* @deprecated 9.3.0 Taxes\Stats\Query class is deprecated, please use GenericQuery or \WC_Object_Query instead.
|
||||
* @deprecated 9.3.0 Taxes\Stats\Query class is deprecated. Please use `GenericQuery`, \WC_Object_Query`, or use `DataStore` directly.
|
||||
*/
|
||||
class Query extends ReportsQuery {
|
||||
|
||||
/**
|
||||
* Valid fields for Taxes report.
|
||||
*
|
||||
* @deprecated 9.3.0 Taxes\Stats\Query class is deprecated, please use GenericQuery or \WC_Object_Query instead.
|
||||
* @deprecated 9.3.0 Taxes\Stats\Query class is deprecated. Please use `GenericQuery`, \WC_Object_Query`, or use `DataStore` directly.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function get_default_query_vars() {
|
||||
wc_deprecated_function( __CLASS__ . '::' . __FUNCTION__, '9.3.0', '`GenericQuery`, `\WC_Object_Query`, or direct `DataStore` use' );
|
||||
|
||||
return array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get tax stats data based on the current query vars.
|
||||
*
|
||||
* @deprecated 9.3.0 Taxes\Stats\Query class is deprecated, please use GenericQuery or \WC_Object_Query instead.
|
||||
* @deprecated 9.3.0 Taxes\Stats\Query class is deprecated. Please use `GenericQuery`, \WC_Object_Query`, or use `DataStore` directly.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function get_data() {
|
||||
wc_deprecated_function( __CLASS__ . '::' . __FUNCTION__, '9.3.0', '`GenericQuery`, `\WC_Object_Query`, or direct `DataStore` use' );
|
||||
|
||||
$args = apply_filters( 'woocommerce_analytics_taxes_stats_query_args', $this->get_query_vars() );
|
||||
|
||||
$data_store = \WC_Data_Store::load( 'report-taxes-stats' );
|
||||
|
|
|
@ -50,7 +50,7 @@ class Controller extends GenericController implements ExportableInterface {
|
|||
);
|
||||
|
||||
/**
|
||||
* Get data from `'variations'` Query.
|
||||
* Get data from `'variations'` GenericQuery.
|
||||
*
|
||||
* @override GenericController::get_datastore_data()
|
||||
*
|
||||
|
|
|
@ -23,29 +23,33 @@ use Automattic\WooCommerce\Admin\API\Reports\Query as ReportsQuery;
|
|||
/**
|
||||
* API\Reports\Variations\Query
|
||||
*
|
||||
* @deprecated 9.3.0 Variations\Query class is deprecated, please use GenericQuery or \WC_Object_Query instead.
|
||||
* @deprecated 9.3.0 Variations\Query class is deprecated. Please use `GenericQuery`, \WC_Object_Query`, or use `DataStore` directly.
|
||||
*/
|
||||
class Query extends ReportsQuery {
|
||||
|
||||
/**
|
||||
* Valid fields for Products report.
|
||||
*
|
||||
* @deprecated 9.3.0 Variations\Query class is deprecated, please use GenericQuery or \WC_Object_Query instead.
|
||||
* @deprecated 9.3.0 Variations\Query class is deprecated. Please use `GenericQuery`, \WC_Object_Query`, or use `DataStore` directly.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function get_default_query_vars() {
|
||||
wc_deprecated_function( __CLASS__ . '::' . __FUNCTION__, '9.3.0', '`GenericQuery`, `\WC_Object_Query`, or direct `DataStore` use' );
|
||||
|
||||
return array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get product data based on the current query vars.
|
||||
*
|
||||
* @deprecated 9.3.0 Variations\Query class is deprecated, please use GenericQuery or \WC_Object_Query instead.
|
||||
* @deprecated 9.3.0 Variations\Query class is deprecated. Please use `GenericQuery`, \WC_Object_Query`, or use `DataStore` directly.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function get_data() {
|
||||
wc_deprecated_function( __CLASS__ . '::' . __FUNCTION__, '9.3.0', '`GenericQuery`, `\WC_Object_Query`, or direct `DataStore` use' );
|
||||
|
||||
$args = apply_filters( 'woocommerce_analytics_variations_query_args', $this->get_query_vars() );
|
||||
|
||||
$data_store = \WC_Data_Store::load( 'report-variations' );
|
||||
|
|
|
@ -46,7 +46,7 @@ class Controller extends GenericStatsController {
|
|||
}
|
||||
|
||||
/**
|
||||
* Get data from `'variations-stats'` Query.
|
||||
* Get data from `'variations-stats'` GenericQuery.
|
||||
*
|
||||
* @override GenericController::get_datastore_data()
|
||||
*
|
||||
|
|
|
@ -23,29 +23,33 @@ use Automattic\WooCommerce\Admin\API\Reports\Query as ReportsQuery;
|
|||
/**
|
||||
* API\Reports\Variations\Stats\Query
|
||||
*
|
||||
* @deprecated 9.3.0 Variations\Stats\Query class is deprecated, please use GenericQuery or \WC_Object_Query instead.
|
||||
* @deprecated 9.3.0 Variations\Stats\Query class is deprecated. Please use `GenericQuery`, \WC_Object_Query`, or use `DataStore` directly.
|
||||
*/
|
||||
class Query extends ReportsQuery {
|
||||
|
||||
/**
|
||||
* Valid fields for Products report.
|
||||
*
|
||||
* @deprecated 9.3.0 Variations\Stats\Query class is deprecated, please use GenericQuery or \WC_Object_Query instead.
|
||||
* @deprecated 9.3.0 Variations\Stats\Query class is deprecated. Please use `GenericQuery`, \WC_Object_Query`, or use `DataStore` directly.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function get_default_query_vars() {
|
||||
wc_deprecated_function( __CLASS__ . '::' . __FUNCTION__, '9.3.0', '`GenericQuery`, `\WC_Object_Query`, or direct `DataStore` use' );
|
||||
|
||||
return array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get variations data based on the current query vars.
|
||||
*
|
||||
* @deprecated 9.3.0 Variations\Stats\Query class is deprecated, please use GenericQuery or \WC_Object_Query instead.
|
||||
* @deprecated 9.3.0 Variations\Stats\Query class is deprecated. Please use `GenericQuery`, \WC_Object_Query`, or use `DataStore` directly.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function get_data() {
|
||||
wc_deprecated_function( __CLASS__ . '::' . __FUNCTION__, '9.3.0', '`GenericQuery`, `\WC_Object_Query`, or direct `DataStore` use' );
|
||||
|
||||
$args = apply_filters( 'woocommerce_analytics_variations_stats_query_args', $this->get_query_vars() );
|
||||
|
||||
$data_store = \WC_Data_Store::load( 'report-variations-stats' );
|
||||
|
|
Loading…
Reference in New Issue