WordPress at a glance
function is not described

WC_REST_Report_Orders_Totals_Controller::prepare_item_for_response() public WC 1.0

Prepare a report object for serialization.

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

Return

WP_REST_Response. $response Response data.

Usage

$WC_REST_Report_Orders_Totals_Controller = new WC_REST_Report_Orders_Totals_Controller();
$WC_REST_Report_Orders_Totals_Controller->prepare_item_for_response( $report, $request );
$report(stdClass) (required)
Report data.
$request(WP_REST_Request) (required)
Request object.

Code of WC_REST_Report_Orders_Totals_Controller::prepare_item_for_response() WC 5.0.0

<?php
public function prepare_item_for_response( $report, $request ) {
	$data = array(
		'slug'  => $report->slug,
		'name'  => $report->name,
		'total' => $report->total,
	);

	$context = ! empty( $request['context'] ) ? $request['context'] : 'view';
	$data    = $this->add_additional_fields_to_object( $data, $request );
	$data    = $this->filter_response_by_context( $data, $context );

	// Wrap the data in a response object.
	$response = rest_ensure_response( $data );

	/**
	 * Filter a report returned from the API.
	 *
	 * Allows modification of the report data right before it is returned.
	 *
	 * @param WP_REST_Response $response The response object.
	 * @param object           $report   The original report object.
	 * @param WP_REST_Request  $request  Request used to generate the response.
	 */
	return apply_filters( 'woocommerce_rest_prepare_report_orders_count', $response, $report, $request );
}