Commit 8ee01ce3 authored by zYne's avatar zYne

--no commit message

--no commit message
parent 8eef3f44
......@@ -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.
......
......@@ -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);
}
}
......
......@@ -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)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment