Exemple #1
0
 /**
  * Get DB connection instance
  * 
  * @return \Kalibri\Db\Driver\Mysql
  */
 protected function db()
 {
     if (!$this->_db) {
         $this->_db = \Kalibri::db()->getConnection($this->connectName);
     }
     return $this->_db;
 }
Exemple #2
0
 /**
  * Execute query on given connection
  * 
  * @param string $dbConnectName DB Connection name
  * 
  * @return \Kalibri\Db\Result\Base
  */
 public function execute($dbConnectName = null)
 {
     if (!$dbConnectName && $this->_connectName) {
         $dbConnectName = $this->_connectName;
     }
     return \Kalibri::db()->getConnection($dbConnectName)->exec($this);
 }