PHP Class WC_REST_Report_Top_Sellers_Controller

Inheritance: extends WC_REST_Report_Sales_Controller
Show file Open project: woocommerce/woocommerce

Protected Properties

Property Type Description
$namespace string Endpoint namespace.
$rest_base string Route base.

Public Methods

Method Description
get_item_schema ( ) : array Get the Report's schema, conforming to JSON Schema.
get_items ( WP_REST_Request $request ) : array | WP_Error Get sales reports.
prepare_item_for_response ( stdClass $top_seller, WP_REST_Request $request ) : WP_REST_Response Prepare a report sales object for serialization.

Method Details

get_item_schema() public method

Get the Report's schema, conforming to JSON Schema.
public get_item_schema ( ) : array
return array

get_items() public method

Get sales reports.
public get_items ( WP_REST_Request $request ) : array | WP_Error
$request WP_REST_Request
return array | WP_Error

prepare_item_for_response() public method

Prepare a report sales object for serialization.
public prepare_item_for_response ( stdClass $top_seller, WP_REST_Request $request ) : WP_REST_Response
$top_seller stdClass
$request WP_REST_Request Request object.
return WP_REST_Response $response Response data.

Property Details

$namespace protected property

Endpoint namespace.
protected string $namespace
return string

$rest_base protected property

Route base.
protected string $rest_base
return string