Automattic\WooCommerce\Internal\CLI\Migrator\Lib

ImportSession::set_stagepublicWC 1.0

Updates the current import stage.

Method of the class: ImportSession{}

No Hooks.

Returns

null. Nothing (null).

Usage

$ImportSession = new ImportSession();
$ImportSession->set_stage( $stage );
$stage(string) (required)
The new stage.

ImportSession::set_stage() code WC 10.7.0

public function set_stage( $stage ) {
	if ( $stage === $this->get_stage() ) {
		return;
	}
	if ( self::STAGE_FINISHED === $stage ) {
		update_post_meta( $this->post_id, 'finished_at', time() );
	}
	update_post_meta( $this->post_id, 'current_stage', $stage );
	$this->cached_stage = $stage;
}