WC_WCCOM_Site_Installation_Manager::reset_installation
Get the next step to run.
Method of the class: WC_WCCOM_Site_Installation_Manager{}
No Hooks.
Returns
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() WC WCCOM Site Installation Manager::reset installation code WC 10.6.2
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;
}