示例#1
0
 public function __construct()
 {
     //TODO connect db
     if (empty($this->db)) {
         $dbAdapter = \Model\DBAdapter::getInstance();
         $this->db = $dbAdapter->db;
         $this->app = $dbAdapter->getApp();
         $dbSetting = $this->app->config('dbsetting');
         $this->_name = $dbSetting['tablePrefix'] . $this->_name;
     }
     $this->setTableFields();
 }
示例#2
0
 protected function _initDB()
 {
     $dbAdapter = \Model\DBAdapter::getInstance();
     $dbAdapter->setApp($this->app);
     $dbAdapter->init();
 }