WC_WCCOM_Site_Installation_State_Storage::save_state()public staticWC 1.0

Save state to storage.

Method of the class: WC_WCCOM_Site_Installation_State_Storage{}

No Hooks.

Return

true|false.

Usage

$result = WC_WCCOM_Site_Installation_State_Storage::save_state( $state ) : bool;
$state(WC_WCCOM_Site_Installation_State) (required)
The state to save.

WC_WCCOM_Site_Installation_State_Storage::save_state() code WC 9.4.2

public static function save_state( WC_WCCOM_Site_Installation_State $state ) : bool {
	$storage_key = self::get_storage_key( $state->get_product_id() );

	return update_option(
		$storage_key,
		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(),
			'download_url'                  => $state->get_download_url(),
			'download_path'                 => $state->get_download_path(),
			'unpacked_path'                 => $state->get_unpacked_path(),
			'installed_path'                => $state->get_installed_path(),
			'already_installed_plugin_info' => $state->get_already_installed_plugin_info(),
			'started_date'                  => $state->get_started_date(),
		)
	);
}