setTransactionClass('Application.Code.DBTransaction'); parent::__construct($dsn, $username, $password, $charset); } private $_transaction = NULL; public function getCurrentTransaction() { if (!$this->_transaction->getActive()) { $this->_transaction = NULL; } return $this->_transaction; } public function beginTransaction() { if ($this->_transaction && $this->_transaction->getActive()) { $this->_transaction->beginNestedTransaction(); } else { $this->_transaction = parent::beginTransaction(); } return $this->_transaction; } } ?>