Automattic\WooCommerce\Database\Migrations

MetaToMetaTableMigrator::fetch_sanitized_migration_data()publicWC 1.0

Return data to be migrated for a batch of entities.

Method of the class: MetaToMetaTableMigrator{}

No Hooks.

Return

Array[]. Data to be migrated. Would be of the form: array( 'data' => array( ... ), 'errors' => array( ... ) ).

Usage

$MetaToMetaTableMigrator = new MetaToMetaTableMigrator();
$MetaToMetaTableMigrator->fetch_sanitized_migration_data( $entity_ids );
$entity_ids(array) (required)
Ids of entities to migrate.

MetaToMetaTableMigrator::fetch_sanitized_migration_data() code WC 9.0.1

public function fetch_sanitized_migration_data( $entity_ids ) {
	$this->clear_errors();
	$to_migrate = $this->fetch_data_for_migration_for_ids( $entity_ids );
	if ( empty( $to_migrate ) ) {
		return array(
			'data'   => array(),
			'errors' => array(),
		);
	}

	$already_migrated = $this->get_already_migrated_records( array_keys( $to_migrate ) );

	return array(
		'data'   => $this->classify_update_insert_records( $to_migrate, $already_migrated ),
		'errors' => $this->get_errors(),
	);
}