WC_REST_WCCOM_Site_Installer_Controller::map_state_to_response
Map the installation state to a response.
Method of the class: WC_REST_WCCOM_Site_Installer_Controller{}
No Hooks.
Returns
Array.
Usage
// protected - for code of main (parent) or child class $result = $this->map_state_to_response( $state );
- $state(WC_WCCOM_Site_Installation_State) (required)
- The installation state.
WC_REST_WCCOM_Site_Installer_Controller::map_state_to_response() WC REST WCCOM Site Installer Controller::map state to response code WC 10.7.0
woocommerce/includes/wccom-site/rest-api/endpoints/class-wc-rest-wccom-site-installer-controller.php
protected function map_state_to_response( $state ) {
return array(
'product_id' => $state->get_product_id(),
'idempotency_key' => $state->get_idempotency_key(),
'last_step_name' => $state->get_last_step_name(),
'last_step_status' => $state->get_last_step_status(),
'last_step_error' => $state->get_last_step_error(),
'product_type' => $state->get_product_type(),
'product_name' => $state->get_product_name(),
'already_installed_plugin_info' => $state->get_already_installed_plugin_info(),
'started_seconds_ago' => time() - $state->get_started_date(),
);
}