Automattic\WooCommerce\Database\Migrations

MetaToCustomTableMigrator::verify_migrated_data()publicWC 1.0

Verify whether data was migrated properly for given IDs.

Метод класса: MetaToCustomTableMigrator{}

No Hooks.

Return

Array. List of IDs along with columns that failed to migrate.

Usage

$MetaToCustomTableMigrator = new MetaToCustomTableMigrator();
$MetaToCustomTableMigrator->verify_migrated_data( $source_ids ) : array;
$source_ids(array) (required)
List of source IDs.

Code of MetaToCustomTableMigrator::verify_migrated_data() WC 7.1.0

public function verify_migrated_data( array $source_ids ) : array {
	global $wpdb;
	$query = $this->build_verification_query( $source_ids );
	// phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared -- $query should already be prepared.
	$results = $wpdb->get_results( $query, ARRAY_A );

	return $this->verify_data( $results );
}