Automattic\WooCommerce\Internal\RestApi\Routes\V4\Refunds\Schema

RefundPreviewSchema::get_product_item_schemaprivateWC 1.0

Schema for an item entry in the products section (extends the base with product_id).

Method of the class: RefundPreviewSchema{}

No Hooks.

Returns

Array.

Usage

// private - for code of main (parent) class only
$result = $this->get_product_item_schema(): array;

RefundPreviewSchema::get_product_item_schema() code WC 11.0.0

private function get_product_item_schema(): array {
	$schema                             = $this->get_base_item_schema();
	$schema['properties']['product_id'] = array(
		'description' => __( 'Product or variation ID.', 'woocommerce' ),
		'type'        => 'integer',
		'context'     => self::VIEW_EDIT_EMBED_CONTEXT,
		'readonly'    => true,
	);
	return $schema;
}