WordPress at a glance
function is not described

Automattic\WooCommerce\Admin\API\Reports\Categories

Controller::get_items() public WC 1.0

Get all reports.

{} It's a method of the class: Controller{}

No Hooks.

Return

Array|WP_Error. Nothing.

Usage

$Controller = new Controller();
$Controller->get_items( $request );
$request(WP_REST_Request) (required)
Request data.

Code of Controller::get_items() WC 5.3.0

<?php
public function get_items( $request ) {
	$query_args       = $this->prepare_reports_query( $request );
	$categories_query = new Query( $query_args );
	$report_data      = $categories_query->get_data();

	if ( is_wp_error( $report_data ) ) {
		return $report_data;
	}

	if ( ! isset( $report_data->data ) || ! isset( $report_data->page_no ) || ! isset( $report_data->pages ) ) {
		return new \WP_Error( 'woocommerce_rest_reports_categories_invalid_response', __( 'Invalid response from data store.', 'woocommerce' ), array( 'status' => 500 ) );
	}

	$out_data = array();

	foreach ( $report_data->data as $datum ) {
		$item       = $this->prepare_item_for_response( $datum, $request );
		$out_data[] = $this->prepare_response_for_collection( $item );
	}

	$response = rest_ensure_response( $out_data );
	$response->header( 'X-WP-Total', (int) $report_data->total );
	$response->header( 'X-WP-TotalPages', (int) $report_data->pages );

	$page      = $report_data->page_no;
	$max_pages = $report_data->pages;
	$base      = add_query_arg( $request->get_query_params(), rest_url( sprintf( '/%s/%s', $this->namespace, $this->rest_base ) ) );
	if ( $page > 1 ) {
		$prev_page = $page - 1;
		if ( $prev_page > $max_pages ) {
			$prev_page = $max_pages;
		}
		$prev_link = add_query_arg( 'page', $prev_page, $base );
		$response->link_header( 'prev', $prev_link );
	}
	if ( $max_pages > $page ) {
		$next_page = $page + 1;
		$next_link = add_query_arg( 'page', $next_page, $base );
		$response->link_header( 'next', $next_link );
	}

	return $response;
}