예제 #1
0
파일: Control.php 프로젝트: xinghao/shs
 /**
  * Leave autocommit mode and begin a transaction.
  *
  * @return bool True
  */
 public function beginTransaction()
 {
     // Get writable adapter.
     $this->_adapter = self::_getAdapterFromPool('master');
     // Begin a transaction.
     $successFlag = $this->_adapter->beginTransaction();
     if ($successFlag) {
         // If begining transaction is successful, set $_isInTransaction flag to true.
         // Once $_isInTransaction = ture, all the adpater return by CrFramework_Db_Control::getAdapter
         // will be master.
         self::$_isInTransaction = true;
     }
     return $successFlag;
 }
예제 #2
0
파일: Table.php 프로젝트: xinghao/shs
 /**
  * Gets a Master database adapter from the pool.
  *
  * @param  none
  * @return $id	database server id
  */
 public function getMasterAdapter()
 {
     $this->_db = CrFramework_Db_Control::getMasterAdapter();
     $this->setDefaultAdapter($this->_db);
     return $this->_db;
 }