WordPress at a glance
function is not described

WC_REST_Customer_Downloads_V1_Controller::prepare_links() protected WC 1.0

Prepare links for the request.

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

No Hooks.

Return

Array. Links for the given customer download.

Usage

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

Code of WC_REST_Customer_Downloads_V1_Controller::prepare_links() WC 5.2.2

<?php
protected function prepare_links( $download, $request ) {
	$base  = str_replace( '(?P<customer_id>[\d]+)', $request['customer_id'], $this->rest_base );
	$links = array(
		'collection' => array(
			'href' => rest_url( sprintf( '/%s/%s', $this->namespace, $base ) ),
		),
		'product' => array(
			'href' => rest_url( sprintf( '/%s/products/%d', $this->namespace, $download->product_id ) ),
		),
		'order' => array(
			'href' => rest_url( sprintf( '/%s/orders/%d', $this->namespace, $download->order_id ) ),
		),
	);

	return $links;
}