yii\db\Exception - Yii2 类参考手册
Class yii\db\Exception
Inheritance | yii\db\Exception » yii\base\Exception » Exception |
---|---|
Subclasses | yii\db\IntegrityException, yii\db\StaleObjectException, yii\elasticsearch\Exception, yii\redis\SocketException |
Available since version | 2.0 |
Exception represents an exception that is caused by some DB-related operations.
Public Properties
隐藏继承的属性 Hide inherited properties
属性Property | 类型 Type | 简介 Description | 定义在 Defined By |
---|---|---|---|
$errorInfo | array | The error info provided by a PDO exception. | yii\db\Exception |
Public Methods
隐藏继承的方法 Hide inherited methods
方法 Method | 简介 Description | 定义在 Defined By |
---|---|---|
__construct() | Constructor. | yii\db\Exception |
__toString() | yii\db\Exception | |
getName() | yii\db\Exception |
属性详情 Property Details
The error info provided by a PDO exception. This is the same as returned by PDO::errorInfo.
方法详情 Method Details
Constructor.
public void __construct ( $message, $errorInfo = [], $code = 0, Exception $previous = null ) | ||
$message | string | PDO error message |
$errorInfo | array | PDO error info |
$code | integer | PDO error code |
$previous | Exception | The previous exception used for the exception chaining. |
public string __toString ( ) | ||
return | string | Readable representation of exception |
---|
public string getName ( ) | ||
return | string | The user-friendly name of this exception |
---|