From 0ed8c17f80442da2863380fdfb4735da2f539b0c Mon Sep 17 00:00:00 2001 From: phpnut Date: Wed, 29 Aug 2007 05:07:16 +0000 Subject: [PATCH] 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 --- cake/libs/model/datasources/dbo/dbo_postgres.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/cake/libs/model/datasources/dbo/dbo_postgres.php b/cake/libs/model/datasources/dbo/dbo_postgres.php index bc50b6a34..ecd1a44b4 100644 --- a/cake/libs/model/datasources/dbo/dbo_postgres.php +++ b/cake/libs/model/datasources/dbo/dbo_postgres.php @@ -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]}"); + } + } } - ?> \ No newline at end of file