Automattic\WooCommerce\StoreApi\Routes\V1

AbstractCartRoute::is_update_request()protectedWC 1.0

Are we updating data or getting data?

Method of the class: AbstractCartRoute{}

No Hooks.

Return

true|false.

Usage

// protected - for code of main (parent) or child class
$result = $this->is_update_request( $request );
$request(\WP_REST_Request) (required)
Request object.

AbstractCartRoute::is_update_request() code WC 9.3.3

protected function is_update_request( \WP_REST_Request $request ) {
	return in_array( $request->get_method(), [ 'POST', 'PUT', 'PATCH', 'DELETE' ], true );
}