1
0
mirror of synced 2025-01-20 07:21:40 +03:00
This commit is contained in:
zYne 2007-06-11 23:37:24 +00:00
parent 8eef3f44c4
commit 8ee01ce3b2
3 changed files with 21 additions and 0 deletions

View File

@ -902,6 +902,22 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
{
return $this->transaction->getTransactionLevel();
}
/**
* lastInsertId
*
* Returns the ID of the last inserted row, or the last value from a sequence object,
* depending on the underlying driver.
*
* Note: This method may not return a meaningful or consistent result across different drivers,
* because the underlying database may not even support the notion of auto-increment fields or sequences.
*
* @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
*/
public function lastInsertId($table = null, $field = null)
{
return $this->sequence->lastInsertId($table, $field);
}
/**
* beginTransaction
* Start a transaction or set a savepoint.

View File

@ -158,6 +158,8 @@ class Doctrine_Formatter extends Doctrine_Connection_Module
case 'gzip':
case 'blob':
case 'clob':
$this->conn->connect();
return $this->conn->getDbh()->quote($input);
}
}

View File

@ -61,11 +61,14 @@ class Doctrine_Sequence_Pgsql extends Doctrine_Sequence
return $result;
}
/**
* lastInsertId
*
* Returns the autoincrement ID if supported or $id or fetches the current
* ID in a sequence called: $table.(empty($field) ? '' : '_'.$field)
*
* @param string name of the table into which a new row was inserted
* @param string name of the field into which a new row was inserted
* @return integer the autoincremented id
*/
public function lastInsertId($table = null, $field = null)
{