WC_WCCOM_Site_Installation_Manager::reset_installation()publicWC 1.0

Get the next step to run.

Method of the class: WC_WCCOM_Site_Installation_Manager{}

No Hooks.

Return

true|false.

Usage

$WC_WCCOM_Site_Installation_Manager = new WC_WCCOM_Site_Installation_Manager();
$WC_WCCOM_Site_Installation_Manager->reset_installation(): bool;

WC_WCCOM_Site_Installation_Manager::reset_installation() code WC 8.7.0

public function reset_installation(): bool {
	$state = WC_WCCOM_Site_Installation_State_Storage::get_state( $this->product_id );

	if ( ! $state ) {
		throw new Installer_Error( Installer_Error_Codes::NO_INITIATED_INSTALLATION_FOUND );
	}

	if ( $state->get_idempotency_key() !== $this->idempotency_key ) {
		throw new Installer_Error( Installer_Error_Codes::IDEMPOTENCY_KEY_MISMATCH );
	}

	$result = WC_WCCOM_Site_Installation_State_Storage::delete_state( $state );
	if ( ! $result ) {
		throw new Installer_Error( Installer_Error_Codes::FAILED_TO_RESET_INSTALLATION_STATE );
	}

	return true;
}