當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Doctrine_Connection::rethrowException方法代碼示例

本文整理匯總了PHP中Doctrine_Connection::rethrowException方法的典型用法代碼示例。如果您正苦於以下問題:PHP Doctrine_Connection::rethrowException方法的具體用法?PHP Doctrine_Connection::rethrowException怎麽用?PHP Doctrine_Connection::rethrowException使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Doctrine_Connection的用法示例。


在下文中一共展示了Doctrine_Connection::rethrowException方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: execute

 /**
  * execute
  * Executes a prepared statement
  *
  * If the prepared statement included parameter markers, you must either:
  * call PDOStatement->bindParam() to bind PHP variables to the parameter markers:
  * bound variables pass their value as input and receive the output value,
  * if any, of their associated parameter markers or pass an array of input-only
  * parameter values
  *
  *
  * @param array $params             An array of values with as many elements as there are
  *                                  bound parameters in the SQL statement being executed.
  * @return boolean                  Returns TRUE on success or FALSE on failure.
  */
 public function execute($params = null)
 {
     try {
         $event = new Doctrine_Event($this, Doctrine_Event::STMT_EXECUTE, $this->getQuery(), $params);
         $this->_conn->getListener()->preStmtExecute($event);
         $result = true;
         if (!$event->skipOperation) {
             if ($this->_conn->getAttribute(Doctrine::PORTABILITY_EMPTY_TO_NULL)) {
                 foreach ($params as $key => $value) {
                     if ($value == '') {
                         $params[$key] = null;
                     }
                 }
             }
             $result = $this->_stmt->execute($params);
             $this->_conn->incrementQueryCount();
         }
         $this->_conn->getListener()->postStmtExecute($event);
         return $result;
     } catch (PDOException $e) {
     } catch (Doctrine_Adapter_Exception $e) {
     }
     $this->_conn->rethrowException($e, $this);
     return false;
 }
開發者ID:swk,項目名稱:bluebox,代碼行數:40,代碼來源:Statement.php

示例2: execute

 /**
  * Executes a prepared statement
  *
  * If the prepared statement included parameter markers, you must either:
  * call PDOStatement->bindParam() to bind PHP variables to the parameter markers:
  * bound variables pass their value as input and receive the output value,
  * if any, of their associated parameter markers or pass an array of input-only
  * parameter values
  *
  *
  * @param array $params             An array of values with as many elements as there are
  *                                  bound parameters in the SQL statement being executed.
  * @return boolean                  Returns TRUE on success or FALSE on failure.
  */
 public function execute($params = null)
 {
     try {
         //$event = new Doctrine_Event($this, Doctrine_Event::STMT_EXECUTE, $this->getQuery(), $params);
         //$this->_conn->getListener()->preStmtExecute($event);
         $result = true;
         //if ( ! $event->skipOperation) {
         $result = $this->_stmt->execute($params);
         //$this->_conn->incrementQueryCount();
         //}
         //$this->_conn->getListener()->postStmtExecute($event);
         return $result;
     } catch (PDOException $e) {
         $this->_conn->rethrowException($e, $this);
     }
     return false;
 }
開發者ID:jackbravo,項目名稱:doctrine,代碼行數:31,代碼來源:Statement.php

示例3: execute

 /**
  * execute
  * Executes a prepared statement
  *
  * If the prepared statement included parameter markers, you must either:
  * call PDOStatement->bindParam() to bind PHP variables to the parameter markers:
  * bound variables pass their value as input and receive the output value,
  * if any, of their associated parameter markers or pass an array of input-only
  * parameter values
  *
  *
  * @param array $params             An array of values with as many elements as there are
  *                                  bound parameters in the SQL statement being executed.
  * @return boolean                  Returns TRUE on success or FALSE on failure.
  */
 public function execute($params = null)
 {
     try {
         $event = new Doctrine_Event($this, Doctrine_Event::STMT_EXECUTE, $this->getQuery(), $params);
         $this->_conn->getListener()->preStmtExecute($event);
         $result = true;
         if (!$event->skipOperation) {
             if ($this->_conn->getAttribute(Doctrine_Core::ATTR_PORTABILITY) & Doctrine_Core::PORTABILITY_EMPTY_TO_NULL) {
                 foreach ($params as $key => $value) {
                     if ($value === '') {
                         $params[$key] = null;
                     }
                 }
             }
             if ($params) {
                 $pos = 0;
                 foreach ($params as $key => $value) {
                     $pos++;
                     $param = is_numeric($key) ? $pos : $key;
                     if (is_resource($value)) {
                         $this->_stmt->bindParam($param, $params[$key], Doctrine_Core::PARAM_LOB);
                     } else {
                         $this->_stmt->bindParam($param, $params[$key]);
                     }
                 }
             }
             $result = $this->_stmt->execute();
             $this->_conn->incrementQueryCount();
         }
         $this->_conn->getListener()->postStmtExecute($event);
         //fix a possible "ORA-01000: maximum open cursors exceeded" when many non-SELECTs are executed and the profiling is enabled
         if ('Oracle' == $this->getConnection()->getDriverName()) {
             $queryBeginningSubstring = strtoupper(substr(ltrim($this->_stmt->queryString), 0, 6));
             if ($queryBeginningSubstring != 'SELECT' && substr($queryBeginningSubstring, 0, 4) != 'WITH') {
                 $this->closeCursor();
             }
         }
         return $result;
     } catch (PDOException $e) {
     } catch (Doctrine_Adapter_Exception $e) {
     }
     $this->_conn->rethrowException($e, $this);
     return false;
 }
開發者ID:lexpress,項目名稱:doctrine1,代碼行數:59,代碼來源:Statement.php

示例4: execute

 /**
  * execute
  * Executes a prepared statement
  *
  * If the prepared statement included parameter markers, you must either:
  * call PDOStatement->bindParam() to bind PHP variables to the parameter markers:
  * bound variables pass their value as input and receive the output value,
  * if any, of their associated parameter markers or pass an array of input-only
  * parameter values
  *
  *
  * @param array $params             An array of values with as many elements as there are
  *                                  bound parameters in the SQL statement being executed.
  * @return boolean                  Returns TRUE on success or FALSE on failure.
  */
 public function execute($params = null)
 {
     try {
         $event = new Doctrine_Event($this, Doctrine_Event::STMT_EXECUTE, $this->getQuery(), $params);
         $this->_conn->getListener()->preStmtExecute($event);
         $result = true;
         if (!$event->skipOperation) {
             if ($this->_conn->getAttribute(Doctrine_Core::ATTR_PORTABILITY) & Doctrine_Core::PORTABILITY_EMPTY_TO_NULL) {
                 foreach ($params as $key => $value) {
                     if ($value === '') {
                         $params[$key] = null;
                     }
                 }
             }
             if ($params) {
                 $pos = 0;
                 foreach ($params as $key => $value) {
                     if ($value === null) {
                         continue;
                     }
                     $pos++;
                     $param = is_numeric($key) ? $pos : $key;
                     if (is_resource($value)) {
                         $this->_stmt->bindParam($param, $params[$key], Doctrine_Core::PARAM_LOB);
                     } else {
                         $this->_stmt->bindParam($param, $params[$key]);
                     }
                 }
             }
             $result = $this->_stmt->execute();
             $this->_conn->incrementQueryCount();
         }
         $this->_conn->getListener()->postStmtExecute($event);
         return $result;
     } catch (PDOException $e) {
     } catch (Doctrine_Adapter_Exception $e) {
     }
     $this->_conn->rethrowException($e, $this);
     return false;
 }
開發者ID:philippjenni,項目名稱:icinga-web,代碼行數:55,代碼來源:Statement.php


注:本文中的Doctrine_Connection::rethrowException方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。