PHP Class WC_API_Reports

Inheritance: extends WC_API_Resource
Afficher le fichier Open project: woocommerce/woocommerce

Protected Properties

Свойство Type Description
$base string the route base

Méthodes publiques

Méthode Description
get_reports ( ) : array Get a simple listing of available reports
get_sales_report ( string $fields = null, array $filter = [] ) : array Get the sales report
get_top_sellers_report ( string $fields = null, array $filter = [] ) : array Get the top sellers report
register_routes ( array $routes ) : array Register the routes for this class

Méthodes protégées

Méthode Description
validate_request ( null $id = null, null $type = null, null $context = null ) : boolean Verify that the current user has permission to view reports

Private Methods

Méthode Description
setup_report ( array $filter ) Setup the report object and parse any date filtering

Method Details

get_reports() public méthode

Get a simple listing of available reports
Since: 2.1
public get_reports ( ) : array
Résultat array

get_sales_report() public méthode

Get the sales report
Since: 2.1
public get_sales_report ( string $fields = null, array $filter = [] ) : array
$fields string fields to include in response
$filter array date filtering
Résultat array

get_top_sellers_report() public méthode

Get the top sellers report
Since: 2.1
public get_top_sellers_report ( string $fields = null, array $filter = [] ) : array
$fields string fields to include in response
$filter array date filtering
Résultat array

register_routes() public méthode

GET /reports GET /reports/sales
Since: 2.1
public register_routes ( array $routes ) : array
$routes array
Résultat array

validate_request() protected méthode

Verify that the current user has permission to view reports
See also: WC_API_Resource::validate_request()
Since: 2.1
protected validate_request ( null $id = null, null $type = null, null $context = null ) : boolean
$id null unused
$type null unused
$context null unused
Résultat boolean true if the request is valid and should be processed, false otherwise

Property Details

$base protected_oe property

the route base
protected string $base
Résultat string