Automattic\WooCommerce\Admin\API\Reports\Categories

Query{}WC 1.0└─ ReportsQuery

Устарела с версии 9.3.0. Больше не поддерживается и может быть удалена. Используйте `GenericQuery`, \WC_Object_Query`, or use `DataStore` directly.

API\Reports\Categories\Query

Использование

$Query = new Query();
// use class methods

Методы

  1. ERROR: no method name found on line ``
  2. public get_data()
  3. ERROR: no method name found on line `* @return array`
  4. ERROR: no method name found on line `* @return array`
  5. ERROR: no method name found on line `*`
  6. protected get_default_query_vars()
  7. ERROR: no method name found on line `* @return array`
  8. ERROR: no method name found on line `* @return array`
  9. ERROR: no method name found on line `*`
  10. ERROR: no method name found on line `*`
  11. ERROR: no method name found on line ``
  12. public load( self::REPORT_NAME )->get_data( $args )
  13. ERROR: no method name found on line `*`
  14. ERROR: no method name found on line ``
  15. ERROR: no method name found on line `*`
  16. ERROR: no method name found on line `* @return array`
  17. ERROR: no method name found on line `* @return array`
  18. ERROR: no method name found on line `* @return array`
  19. ERROR: no method name found on line `*`
  20. ERROR: no method name found on line ``
  21. ERROR: no method name found on line `* @return array`
  22. ERROR: no method name found on line `* @return array`
  23. ERROR: no method name found on line `*`
  24. ERROR: no method name found on line `}`
  25. ERROR: no method name found on line `*`
  26. ERROR: no method name found on line `*`
  27. ERROR: no method name found on line `*`
  28. public array()
  29. ERROR: no method name found on line `* @return array`
  30. ERROR: no method name found on line `*`
  31. ERROR: no method name found on line `* @return array`

Список изменений

Устарела с 9.3.0 Categories\Query class is deprecated. Please use GenericQuery, \WC_Object_Query, or useDataStore` directly.

Код Query{} WC 9.9.3

class Query extends ReportsQuery {

	const REPORT_NAME = 'report-categories';

	/**
	 * Valid fields for Categories report.
	 *
	 * @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`, \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 );
	}
}