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