AbstractRoute
AbstractRoute class.
Description Description
Source Source
File: packages/woocommerce-blocks/src/StoreApi/Routes/AbstractRoute.php
Methods Methods
- __construct — Constructor.
- error_to_response — Converts an error to a response object. Based on \WP_REST_Server.
- get_collection_params — Retrieves the query params for the collections.
- get_context_param — Retrieves the context param.
- get_item_schema — Get item schema properties.
- get_namespace — Get the namespace for this route.
- get_response — Get the route response based on the type of request.
- get_route_delete_response — Get route response for DELETE requests.
- get_route_error_response — Get route response when something went wrong.
- get_route_error_response_from_object — Get route response when something went wrong and the supplied error is a WP_Error. This currently only happens when an item in the cart is out of stock, partially out of stock, can only be bought individually, or when the item is not purchasable.
- get_route_post_response — Get route response for POST requests.
- get_route_response — Get route response for GET requests.
- get_route_update_response — Get route response for PUT requests.
- prepare_item_for_response — Prepare a single item for response.
- prepare_links — Prepare links for the request.
- prepare_response_for_collection — Prepares a response for insertion into a collection.