Automattic\WooCommerce\Blueprint

ImportStep::importpublicWC 1.0

Import the schema steps.

Method of the class: ImportStep{}

No Hooks.

Returns

StepProcessorResult.

Usage

$ImportStep = new ImportStep();
$ImportStep->import();

ImportStep::import() code WC 9.9.5

public function import() {
	$result = StepProcessorResult::success( $this->step_definition->step );

	if ( ! $this->can_import( $result ) ) {
		return $result;
	}

	$importer = $this->indexed_importers[ $this->step_definition->step ];
	$logger   = new Logger();
	$logger->start_import( $this->step_definition->step, get_class( $importer ) );

	$importer_result = $importer->process( $this->step_definition );

	if ( $importer_result->is_success() ) {
		$logger->complete_import( $this->step_definition->step, $importer_result );
	} else {
		$logger->import_step_failed( $this->step_definition->step, $importer_result );
	}

	$result->merge_messages( $importer_result );

	return $result;
}