> YII 类库手册 > CDbException
system.db
继承 class CDbException » CException » Exception
源自 1.0
版本 $Id: CDbException.PHP 2799 2011-01-01 19:31:13Z qiang.xue $
源码
CDbException代表一个数据库相关操作导致的异常。

公共属性

属性 类型 描述 定义在
errorInfo mixed 一个PDO异常提供的错误信息。 该参数返回与{@link Http://www. CDbException

受保护属性

属性 类型 描述 定义在
code Exception
file Exception
line Exception
message Exception

公共方法

方法 描述 定义在
__construct() 构造函数。 CDbException
__toString() Exception
getCode() Exception
getFile() Exception
getLine() Exception
getMessage() Exception
getPrevious() Exception
getTrace() Exception
getTraceAsString() Exception

属性详细

errorInfo 属性 (可用自 v1.1.4)
public mixed $errorInfo;

一个PDO异常提供的错误信息。 该参数返回与PDO::errorInfo是一样的。

方法详细

__construct() 方法
public void __construct(string $message, integer $code=0, mixed $errorInfo=NULL)
$message string PDO 错误信息
$code integer PDO 错误代码
$errorInfo mixed PDO 错误信息
public function __construct($message,$code=0,$errorInfo=null)
{
    
$this->errorInfo=$errorInfo;
    
parent::__construct($message,$code);
}

构造函数。

上一篇:
下一篇: