original_string: protected function insert_chunk($table, array $chunk, array $columns) {
          $i = 1;
          $params = array();
          $values = array();
          foreach ($chunk as $dataobject) {
              $vals = array();
              foreach ($columns as $field => $column) {
                  $params[] = $this->normalise_value($column, $dataobject[$field]);
                  $vals[] = "\$".$i++;
              }
              $values[] = '('.implode(',', $vals).')';
          }
  
          $fieldssql = '('.implode(',', array_keys($columns)).')';
          $valuessql = implode(',', $values);
  
          $sql = "INSERT INTO {$this->prefix}$table $fieldssql VALUES $valuessql";
          $this->query_start($sql, $params, SQL_QUERY_INSERT);
          $result = pg_query_params($this->pgsql, $sql, $params);
          $this->query_end($result);
          pg_free_result($result);
      }
code: protected function insert_chunk($table, array $chunk, array $columns) {
          $i = 1;
          $params = array();
          $values = array();
          foreach ($chunk as $dataobject) {
              $vals = array();
              foreach ($columns as $field => $column) {
                  $params[] = $this->normalise_value($column, $dataobject[$field]);
                  $vals[] = "\$".$i++;
              }
              $values[] = '('.implode(',', $vals).')';
          }
  
          $fieldssql = '('.implode(',', array_keys($columns)).')';
          $valuessql = implode(',', $values);
  
          $sql = "INSERT INTO {$this->prefix}$table $fieldssql VALUES $valuessql";
          $this->query_start($sql, $params, SQL_QUERY_INSERT);
          $result = pg_query_params($this->pgsql, $sql, $params);
          $this->query_end($result);
          pg_free_result($result);
      }
code_tokens: protected function insert_chunk ( $ table , array $ chunk , array $ columns ) { $ i = 1 ; $ params = array ( ) ; $ values = array ( ) ; foreach ( $ chunk as $ dataobject ) { $ vals = array ( ) ; foreach ( $ columns as $ field => $ column ) { $ params [ ] = $ this -> normalise_value ( $ column , $ dataobject [ $ field ] ) ; $ vals [ ] = "\$" . $ i ++ ; } $ values [ ] = '(' . implode ( ',' , $ vals ) . ')' ; } $ fieldssql = '(' . implode ( ',' , array_keys ( $ columns ) ) . ')' ; $ valuessql = implode ( ',' , $ values ) ; $ sql = "INSERT INTO {$this->prefix}$table $fieldssql VALUES $valuessql" ; $ this -> query_start ( $ sql , $ params , SQL_QUERY_INSERT ) ; $ result = pg_query_params ( $ this -> pgsql , $ sql , $ params ) ; $ this -> query_end ( $ result ) ; pg_free_result ( $ result ) ; }
docstring: Insert records in chunks, strict param types...
  
  Note: can be used only from insert_records().
  
  @param string $table
  @param array $chunk
  @param database_column_info[] $columns
docstring_tokens: Insert records in chunks strict param types ...