From cd562f52bad9aca436335dfa0b5b26dab954c7f4 Mon Sep 17 00:00:00 2001 From: Jose Lorenzo Rodriguez Date: Sat, 7 Jan 2012 00:37:50 -0430 Subject: [PATCH] Fixing a couple failing tests on windows using sqlserver --- lib/Cake/Model/Datasource/Database/Sqlserver.php | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/lib/Cake/Model/Datasource/Database/Sqlserver.php b/lib/Cake/Model/Datasource/Database/Sqlserver.php index 9e60c1622..df5cd8884 100644 --- a/lib/Cake/Model/Datasource/Database/Sqlserver.php +++ b/lib/Cake/Model/Datasource/Database/Sqlserver.php @@ -645,14 +645,7 @@ class Sqlserver extends DboSource { $this->_execute('SET IDENTITY_INSERT ' . $this->fullTableName($table) . ' ON'); } - $table = $this->fullTableName($table); - $fields = implode(', ', array_map(array(&$this, 'name'), $fields)); - $this->begin(); - foreach ($values as $value) { - $holder = implode(', ', array_map(array(&$this, 'value'), $value)); - $this->_execute("INSERT INTO {$table} ({$fields}) VALUES ({$holder})"); - } - $this->commit(); + parent::insertMulti($table, $fields, $values); if ($hasPrimaryKey) { $this->_execute('SET IDENTITY_INSERT ' . $this->fullTableName($table) . ' OFF'); @@ -717,9 +710,6 @@ class Sqlserver extends DboSource { * @return string */ protected function _getPrimaryKey($model) { - if (!is_object($model)) { - $model = new Model(false, $model); - } $schema = $this->describe($model); foreach ($schema as $field => $props) { if (isset($props['key']) && $props['key'] == 'primary') {