コード例 #1
0
ファイル: Abstract.php プロジェクト: jsiefer/emarketing
 /**
  * Update stats table from select
  *
  * @param Zend_Db_Select $select
  * @param array $fields
  * @return Zend_Db_Statement_Interface
  */
 protected function insertSelect(Mzax_Emarketing_Db_Select $select, $table = null)
 {
     $sql = $select->insertFromSelect($this->_getTable($table ? $table : $this->_reportTable));
     $startTime = microtime(true);
     try {
         $this->log("\n\n\n\n{$sql}\n");
         $this->_getWriteAdapter()->query($sql);
         $duration = microtime(true) - $startTime;
         $this->log("QueryTime [%s]: %01.4fsec\n\n", get_class($this), microtime(true) - $startTime);
         return $duration;
     } catch (Exception $e) {
         $this->log($e->getMessage());
         $this->log($e->getTraceAsString());
         $this->log($sql);
         throw $e;
     }
 }