Automattic\WooCommerce\Database\Migrations

MetaToMetaTableMigrator::fetch_sanitized_migration_data()publicWC 1.0

Return data to be migrated for a batch of entities.

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

Хуков нет.

Возвращает

Массив[]. Data to be migrated. Would be of the form: array( 'data' => array( ... ), 'errors' => array( ... ) ).

Использование

$MetaToMetaTableMigrator = new MetaToMetaTableMigrator();
$MetaToMetaTableMigrator->fetch_sanitized_migration_data( $entity_ids );
$entity_ids(массив) (обязательный)
Ids of entities to migrate.

Код MetaToMetaTableMigrator::fetch_sanitized_migration_data() WC 9.2.3

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(),
	);
}