Esempio n. 1
0
 /**
  * Create pdo statement instance using conditions 
  *
  * @return void
  */
 protected function _createStatement()
 {
     $sql = $this->getSql();
     if (self::$_preparing == false || !$this->_statement instanceof PDOStatement) {
         $this->_statement = $this->_adapter->prepare($sql);
     } else {
         if ($this->_statement->queryString != $sql) {
             $this->_statement = $this->_adapter->prepare($sql);
         }
     }
     if (is_array($this->_params) && count($this->_params) > 0) {
         foreach ($this->_params as $key => $val) {
             $this->_statement->bindValue(':' . $key, $val);
         }
     }
     Db::addSqlHistory($sql, $this->_params);
 }
Esempio n. 2
0
 /**
  * Rollback the database transaction
  *
  * @return void
  */
 protected function rollback()
 {
     $this->db->rollback();
 }