[2.0] Formatting issues.
This commit is contained in:
parent
f01320665a
commit
d80b95964e
@ -661,48 +661,48 @@ class Connection
|
|||||||
* @param string $table Name of the table into which a new row was inserted.
|
* @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.
|
* @param string $field Name of the field into which a new row was inserted.
|
||||||
*/
|
*/
|
||||||
public function lastInsertId($seqName = null)
|
public function lastInsertId($seqName = null)
|
||||||
{
|
{
|
||||||
$this->connect();
|
$this->connect();
|
||||||
return $this->_conn->lastInsertId($seqName);
|
return $this->_conn->lastInsertId($seqName);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Start a transaction or set a savepoint.
|
* Start a transaction or set a savepoint.
|
||||||
*
|
*
|
||||||
* if trying to set a savepoint and there is no active transaction
|
* if trying to set a savepoint and there is no active transaction
|
||||||
* a new transaction is being started.
|
* a new transaction is being started.
|
||||||
*
|
*
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
public function beginTransaction()
|
public function beginTransaction()
|
||||||
{
|
{
|
||||||
$this->connect();
|
$this->connect();
|
||||||
if ($this->_transactionNestingLevel == 0) {
|
if ($this->_transactionNestingLevel == 0) {
|
||||||
$this->_conn->beginTransaction();
|
$this->_conn->beginTransaction();
|
||||||
}
|
}
|
||||||
++$this->_transactionNestingLevel;
|
++$this->_transactionNestingLevel;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Commits the database changes done during a transaction that is in
|
* Commits the database changes done during a transaction that is in
|
||||||
* progress or release a savepoint. This function may only be called when
|
* progress or release a savepoint. This function may only be called when
|
||||||
* auto-committing is disabled, otherwise it will fail.
|
* auto-committing is disabled, otherwise it will fail.
|
||||||
*
|
*
|
||||||
* @return boolean FALSE if commit couldn't be performed, TRUE otherwise
|
* @return boolean FALSE if commit couldn't be performed, TRUE otherwise
|
||||||
*/
|
*/
|
||||||
public function commit()
|
public function commit()
|
||||||
{
|
{
|
||||||
if ($this->_transactionNestingLevel == 0) {
|
if ($this->_transactionNestingLevel == 0) {
|
||||||
throw ConnectionException::commitFailedNoActiveTransaction();
|
throw ConnectionException::commitFailedNoActiveTransaction();
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->connect();
|
$this->connect();
|
||||||
|
|
||||||
if ($this->_transactionNestingLevel == 1) {
|
if ($this->_transactionNestingLevel == 1) {
|
||||||
$this->_conn->commit();
|
$this->_conn->commit();
|
||||||
}
|
}
|
||||||
--$this->_transactionNestingLevel;
|
--$this->_transactionNestingLevel;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -722,7 +722,7 @@ class Connection
|
|||||||
* @return boolean FALSE if rollback couldn't be performed, TRUE otherwise.
|
* @return boolean FALSE if rollback couldn't be performed, TRUE otherwise.
|
||||||
*/
|
*/
|
||||||
public function rollback()
|
public function rollback()
|
||||||
{
|
{
|
||||||
if ($this->_transactionNestingLevel == 0) {
|
if ($this->_transactionNestingLevel == 0) {
|
||||||
throw ConnectionException::rollbackFailedNoActiveTransaction();
|
throw ConnectionException::rollbackFailedNoActiveTransaction();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user