Created
March 31, 2016 13:38
-
-
Save mutyonok/6eb585a11af7e95e269d73de75017a88 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function batchInsert($table, $columns, $rows) | |
{ | |
$quotedTable = $this->db->quoteSql($table); | |
$quotedColumns = []; | |
foreach ($columns as $column) { | |
$quotedColumns[] = $this->db->quoteSql($column); | |
} | |
$sql = $this->db->getQueryBuilder()->batchInsert($quotedTable, $quotedColumns, $rows); | |
$this->setSql($sql); //but do not quote this SQL as it was already quoted | |
return $this; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment