Automattic\WooCommerce\Database\Migrations
MetaToCustomTableMigrator::process_update_batch
Process batch for update into destination table.
Метод класса: MetaToCustomTableMigrator{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
// private - только в коде основоного (родительского) класса $result = $this->process_update_batch( $batch, $ids_mapping ): void;
- $batch(массив) (обязательный)
- Data to insert, will be of the form as returned by
datainfetch_data_for_migration_for_ids. - $ids_mapping(массив) (обязательный)
- Maps rows to update data with their original IDs.
Код MetaToCustomTableMigrator::process_update_batch() MetaToCustomTableMigrator::process update batch WC 10.7.0
private function process_update_batch( array $batch, array $ids_mapping ): void {
if ( 0 === count( $batch ) ) {
return;
}
$queries = $this->generate_update_sql_for_batch( $batch, $ids_mapping );
// phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared -- Queries should already be prepared.
$processed_rows_count = $this->db_query( $queries ) / 2;
$this->maybe_add_insert_or_update_error( 'update', $processed_rows_count );
}