Automattic\WooCommerce\StoreApi\Routes\V1

ShopperLists::get_route_responseprotectedWC 1.0

Return the lists for the current user.

Method of the class: ShopperLists{}

No Hooks.

Returns

\WP_REST_Response.

Usage

// protected - for code of main (parent) or child class
$result = $this->get_route_response( $request );
$request(WP_REST_Request) (required)
Request object.

ShopperLists::get_route_response() code WC 10.9.1

protected function get_route_response( \WP_REST_Request $request ) {
	$response = array();

	foreach ( ShopperList::get_all_for_user() as $list ) {
		$response[] = $this->prepare_response_for_collection( $this->prepare_item_for_response( $list, $request ) );
	}

	return rest_ensure_response( $response );
}