WC_REST_WCCOM_Site_Installer_Controller::map_state_to_response()protectedWC 1.0

Map the installation state to a response.

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

Хуков нет.

Возвращает

Массив.

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

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->map_state_to_response( $state );
$state(WC_WCCOM_Site_Installation_State) (обязательный)
The installation state.

Код WC_REST_WCCOM_Site_Installer_Controller::map_state_to_response() WC 9.8.2

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(),
	);
}