Automattic\WooCommerce\Database\Migrations

TableMigrator::process_migration_batch_for_ids()publicWC 1.0

Deprecated from version 8.0.0. It is no longer supported and can be removed in future releases. Use `fetch_sanitized_migration_data` and `process_migration_data` instead.

Migrate a batch of orders, logging any database error that could arise and the exception thrown if any.

Method of the class: TableMigrator{}

No Hooks.

Return

Array. An array containing the keys 'errors' (array of strings) and 'exception' (exception object or null).

Usage

$TableMigrator = new TableMigrator();
$TableMigrator->process_migration_batch_for_ids( $entity_ids ): array;
$entity_ids(array) (required)
Order ids to migrate.

Changelog

Deprecated since 8.0.0 Use fetch_sanitized_migration_data and process_migration_data instead.

TableMigrator::process_migration_batch_for_ids() code WC 8.7.0

public function process_migration_batch_for_ids( array $entity_ids ): array {
	$this->clear_errors();
	$exception = null;

	try {
		$this->process_migration_batch_for_ids_core( $entity_ids );
	} catch ( \Exception $ex ) {
		$exception = $ex;
	}

	return array(
		'errors'    => $this->get_errors(),
		'exception' => $exception,
	);
}