Exemple #1
0
 /**
  * 创建模型
  * @param string 要使用的数据库配置
  * @return void
  */
 public function __construct($key = 'mysql')
 {
     // 读取配置
     $driver = \Core\C::G($key);
     // 创建数据库
     $this->db = Mysql::instance($driver);
 }
Exemple #2
0
 /**
  * 检查是否在事务内
  * @return bool
  */
 public final function in()
 {
     return $this->db->inTransaction();
 }