Automattic\WooCommerce\Admin\API\Reports\Coupons

Controller::prepare_links()protectedWC 1.0

Prepare links for the request.

Method of the class: Controller{}

No Hooks.

Return

Array.

Usage

// protected - for code of main (parent) or child class
$result = $this->prepare_links( $object );
$object(WC_Reports_Query) (required)
Object data.

Controller::prepare_links() code WC 7.3.0

protected function prepare_links( $object ) {
	$links = array(
		'coupon' => array(
			'href' => rest_url( sprintf( '/%s/coupons/%d', $this->namespace, $object['coupon_id'] ) ),
		),
	);

	return $links;
}