Automattic\WooCommerce\Internal\CLI\Migrator\Lib
ImportSession::set_stage
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() 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;
}