From 231be6550b80c6f821616075d8caca210e3a784a Mon Sep 17 00:00:00 2001 From: zYne Date: Sun, 19 Nov 2006 22:16:12 +0000 Subject: [PATCH] --- lib/Doctrine/Connection/Mssql.php | 24 +++++++++++------------- lib/Doctrine/Connection/Mysql.php | 4 ++-- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/lib/Doctrine/Connection/Mssql.php b/lib/Doctrine/Connection/Mssql.php index 8904ce8b2..664cb31f2 100644 --- a/lib/Doctrine/Connection/Mssql.php +++ b/lib/Doctrine/Connection/Mssql.php @@ -22,15 +22,15 @@ Doctrine::autoload('Doctrine_Connection'); /** * Doctrine_Connection_Mssql * - * @package Doctrine - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @author Konsta Vesterinen + * @package Doctrine + * @license http://www.opensource.org/licenses/lgpl-license.php LGPL + * @author Konsta Vesterinen * @author Lukas Smith (PEAR MDB2 library) - * @version $Revision$ - * @category Object Relational Mapping - * @link www.phpdoctrine.com - * @since 1.0 - */ + * @version $Revision$ + * @category Object Relational Mapping + * @link www.phpdoctrine.com + * @since 1.0 + */ class Doctrine_Connection_Mssql extends Doctrine_Connection { /** * @var string $driverName the name of this connection driver @@ -153,11 +153,9 @@ class Doctrine_Connection_Mssql extends Doctrine_Connection { * * @param string $table name of the table into which a new row was inserted * @param string $field name of the field into which a new row was inserted - * @return mixed MDB2 Error Object or id - * @access public + * @return integer */ - function lastInsertID($table = null, $field = null) - { + public function lastInsertID($table = null, $field = null) { $server_info = $this->getServerVersion(); if (is_array($server_info) && !is_null($server_info['major']) @@ -167,7 +165,7 @@ class Doctrine_Connection_Mssql extends Doctrine_Connection { $query = "SELECT @@IDENTITY"; } - return $this->queryOne($query, 'integer'); + return $this->queryOne($query); } } diff --git a/lib/Doctrine/Connection/Mysql.php b/lib/Doctrine/Connection/Mysql.php index df7aff261..a5ea70d17 100644 --- a/lib/Doctrine/Connection/Mysql.php +++ b/lib/Doctrine/Connection/Mysql.php @@ -80,7 +80,7 @@ class Doctrine_Connection_Mysql extends Doctrine_Connection_Common { * * @return integer */ - public function nextID($seqName, $ondemand = true) { + public function nextId($seqName, $ondemand = true) { $sequenceName = $this->quoteIdentifier($this->getSequenceName($seqName), true); $seqcolName = $this->quoteIdentifier($this->getAttribute(Doctrine::ATTR_SEQCOL_NAME), true); $query = 'INSERT INTO ' . $sequenceName . ' (' . $seqcolName . ') VALUES (NULL)'; @@ -99,7 +99,7 @@ class Doctrine_Connection_Mysql extends Doctrine_Connection_Common { * @param string $seq_name name of the sequence * @return integer */ - public function currID($seqName) { + public function currId($seqName) { $sequenceName = $this->quoteIdentifier($this->getSequenceName($seqName), true); $seqcolName = $this->quoteIdentifier($this->options['seqcol_name'], true); $query = 'SELECT MAX(' . $seqcolName . ') FROM ' . $sequenceName;