diff options
| author | xue <> | 2008-03-12 18:15:01 +0000 | 
|---|---|---|
| committer | xue <> | 2008-03-12 18:15:01 +0000 | 
| commit | 0c6fa4ad25c64fa4033838feb298c92edd1651b4 (patch) | |
| tree | 085091629eb32fb8adea6eb4db4fe7ba2dfb9594 | |
| parent | 7e5a685ed31b65ddd75196d4616ab142c39af8d9 (diff) | |
fixed #741.
| -rw-r--r-- | HISTORY | 3 | ||||
| -rw-r--r-- | framework/Data/TDbConnection.php | 16 | 
2 files changed, 17 insertions, 2 deletions
@@ -22,7 +22,8 @@ CHG: Changed TConditional so that the controls in its template behave like they  CHG: Active Record many-to-many relationship change from self::HAS_MANY to self::MANY_TO_MANY (Wei)  CHG: Active Record no longer automatically performs adding/removing/updating related objects (Qiang)  CHG: TJavaScript::encode() will encode data as a list if integer indices are detected (Qiang) -ENH: Ticket#722 - Add Read Only capabilities to TInPlaceTextBox (Christophe) +ENH: Ticket#722 - Added Read Only capabilities to TInPlaceTextBox (Christophe) +ENH: Ticket#741 - Added CDbConnection.currentTransaction property (Qiang)  ENH: Ticket#743 - Added status code header in HTTP response when in error (Qiang)  ENH: Ticket#783 - Added date/time type support to soap implementation (Hongliang)  ENH: Active Record supports multiple foreign references of the same table (Wei) diff --git a/framework/Data/TDbConnection.php b/framework/Data/TDbConnection.php index 23a6e58b..1f2782db 100644 --- a/framework/Data/TDbConnection.php +++ b/framework/Data/TDbConnection.php @@ -85,6 +85,7 @@ class TDbConnection extends TComponent  	private $_attributes=array();
  	private $_active=false;
  	private $_pdo=null;
 +	private $_transaction;
  	/**
  	 * Constructor.
 @@ -250,6 +251,19 @@ class TDbConnection extends TComponent  	}
  	/**
 +	 * @return CDbTransaction the currently active transaction. Null if no active transaction.
 +	 */
 +	public function getCurrentTransaction()
 +	{
 +		if($this->_transaction!==null)
 +		{
 +			if($this->_transaction->getActive())
 +				return $this->_transaction;
 +		}
 +		return null;
 +	}
 +
 +	/**
  	 * Starts a transaction.
  	 * @return TDbTransaction the transaction initiated
  	 * @throws TDbException if the connection is not active
 @@ -259,7 +273,7 @@ class TDbConnection extends TComponent  		if($this->getActive())
  		{
  			$this->_pdo->beginTransaction();
 -			return new TDbTransaction($this);
 +			return $this->_transaction=new TDbTransaction($this);
  		}
  		else
  			throw new TDbException('dbconnection_connection_inactive');
  | 
