getException() 공개 정적인 메소드

public static getException ( $errorInfo, $querySql )
 public function createPDOStatement($dbHandle, $sql, $boundValues, $queryString)
 {
     $pdoStatement = $dbHandle->prepare($sql);
     if (!$pdoStatement) {
         throw PDOExceptionExtractor::getException($dbHandle->errorInfo(), $queryString);
     }
     foreach ($boundValues as $key => $valueBind) {
         $type = ParameterType::getType($valueBind);
         $pdoStatement->bindValue($key + 1, $valueBind, $type);
     }
     try {
         if (!$pdoStatement->execute()) {
             throw PDOExceptionExtractor::getException($pdoStatement->errorInfo(), $queryString);
         }
     } catch (PDOException $exception) {
         $errorInfo = array($exception->getCode(), $exception->getCode(), $exception->getMessage());
         throw PDOExceptionExtractor::getException($errorInfo, $queryString);
     }
     return $pdoStatement;
 }
예제 #2
0
파일: Db.php 프로젝트: letsdrink/ouzo
 public function lastInsertId($sequence)
 {
     $lastInsertId = $this->_dbHandle->lastInsertId($sequence);
     if (!$lastInsertId) {
         throw PDOExceptionExtractor::getException($this->_dbHandle->errorInfo(), "Cannot get sequence value: {$sequence}");
     }
     return $lastInsertId;
 }