Automattic\WooCommerce\Internal\RestApi\Routes\V4\Refunds\Schema
RefundPreviewSchema::get_item_response
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.
Method of the class: RefundPreviewSchema{}
No Hooks.
Returns
Array.
Usage
$RefundPreviewSchema = new RefundPreviewSchema(); $RefundPreviewSchema->get_item_response( $item, $request, $include_fields ): array;
- $item(mixed) (required)
- Item data.
- $request(WP_REST_Request) (required)
- Request object.
- $include_fields(array)
- Fields to include.
Default:array()
Changelog
| Since 10.9.0 | Introduced. |
RefundPreviewSchema::get_item_response() RefundPreviewSchema::get item response code WC 11.0.1
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().'
);
}