1
0
mirror of synced 2025-01-18 22:41:43 +03:00
This commit is contained in:
zYne 2006-11-19 22:16:12 +00:00
parent 5a5934db0b
commit 231be6550b
2 changed files with 13 additions and 15 deletions

View File

@ -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 <kvesteri@cc.hut.fi>
* @package Doctrine
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
* @author Lukas Smith <smith@pooteeweet.org> (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);
}
}

View File

@ -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;