WordPress at a glance
function is not described

Automattic\WooCommerce\Admin\API\Reports\Import

Controller::prepare_item_for_response() public WC 1.0

Prepare the data object for response.

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

Return

WP_REST_Response. $response Response data.

Usage

$Controller = new Controller();
$Controller->prepare_item_for_response( $item, $request );
$item(object) (required)
Data object.
$request(WP_REST_Request) (required)
Request object.

Code of Controller::prepare_item_for_response() WC 5.3.0

<?php
public function prepare_item_for_response( $item, $request ) {
	$data     = $this->add_additional_fields_to_object( $item, $request );
	$data     = $this->filter_response_by_context( $data, 'view' );
	$response = rest_ensure_response( $data );

	/**
	 * Filter the list returned from the API.
	 *
	 * @param WP_REST_Response $response The response object.
	 * @param array            $item     The original item.
	 * @param WP_REST_Request  $request  Request used to generate the response.
	 */
	return apply_filters( 'woocommerce_rest_prepare_reports_import', $response, $item, $request );
}