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

RefundPreviewSchema::get_item_response │ public │ WC 10.9.0

Not used. The refund preview controller bypasses prepare_item_for_response and returns the raw data array directly via rest_ensure_response, so this method must never be invoked. The : array return type is required to satisfy AbstractSchema::get_item_response, but the body always throws.

Метод класса: RefundPreviewSchema{}

Хуков нет.

Возвращает

array.

Использование

$RefundPreviewSchema = new RefundPreviewSchema();
$RefundPreviewSchema->get_item_response( $item, $request, $include_fields ): array;
$item(разное) (обязательный)
Item data.
$request(WP_REST_Request) (обязательный)
Request object.
$include_fields(массив)
Fields to include.
По умолчанию: array()

Список изменений

С версии 10.9.0 Введена.

Код RefundPreviewSchema::get_item_response() WC 11.2.2

public function get_item_response( $item, WP_REST_Request $request, array $include_fields = array() ): array {
	throw new \LogicException(
		'RefundPreviewSchema::get_item_response() should not be called; the preview controller bypasses prepare_item_for_response().'
	);
}