WC_WCCOM_Site_Installation_State_Storage::save_state()public staticWC 1.0

Save state to storage.

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

Хуков нет.

Возвращает

true|false.

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

$result = WC_WCCOM_Site_Installation_State_Storage::save_state( $state ) : bool;
$state(WC_WCCOM_Site_Installation_State) (обязательный)
The state to save.

Код WC_WCCOM_Site_Installation_State_Storage::save_state() 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(),
		)
	);
}