mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 02:56:15 +00:00
Fixes Ticket #2999, HABTM save multiple for PostgreSQL
Merged changes from 1.2 DboOdbc into 1.1 git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5603 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
51418a07da
commit
0ed8c17f80
1 changed files with 13 additions and 1 deletions
|
@ -578,6 +578,18 @@ class DboPostgres extends DboSource {
|
|||
function getEncoding() {
|
||||
return pg_client_encoding($this->connection);
|
||||
}
|
||||
/**
|
||||
* Inserts multiple values into a join table
|
||||
*
|
||||
* @param string $table
|
||||
* @param string $fields
|
||||
* @param array $values
|
||||
*/
|
||||
function insertMulti($table, $fields, $values) {
|
||||
$count = count($values);
|
||||
for ($x = 0; $x < $count; $x++) {
|
||||
$this->query("INSERT INTO {$table} ({$fields}) VALUES {$values[$x]}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
Loading…
Add table
Reference in a new issue