WordPress at Your Fingertips
function is not described

Automattic\WooCommerce\Blocks\StoreApi\Routes

CartItems::prepare_links() protected WC 1.0

Prepare links for the request.

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

No Hooks.

Return

Array.

Usage

// protected - for code of main (parent) or child class
$result = $this->prepare_links( $cart_item, $request );
$cart_item(array) (required)
Object to prepare.
$request(\WP_REST_Request) (required)
Request object.

Code of CartItems::prepare_links() WC 5.6.0

protected function prepare_links( $cart_item, $request ) {
	$base  = $this->get_namespace() . $this->get_path();
	$links = array(
		'self'       => array(
			'href' => rest_url( trailingslashit( $base ) . $cart_item['key'] ),
		),
		'collection' => array(
			'href' => rest_url( $base ),
		),
	);
	return $links;
}