0 フォロワー

クラス yii\db\IntegrityException

継承yii\db\IntegrityException » yii\db\Exception » yii\base\Exception » Exception
利用可能なバージョン2.0
ソースコード https://github.com/yiisoft/yii2/blob/master/framework/db/IntegrityException.php

例外は、DB制約の違反によって発生する例外を表します。

パブリックプロパティ

継承されたプロパティを隠す

プロパティ タイプ 説明 定義元
$errorInfo 配列 PDO例外によって提供されるエラー情報。 yii\db\Exception

パブリックメソッド

継承されたメソッドを隠す

メソッド 説明 定義元
__construct() コンストラクタ。 yii\db\Exception
__toString() yii\db\Exception
getName() yii\db\IntegrityException

メソッドの詳細

継承されたメソッドを隠す

__construct() public method

定義元: yii\db\Exception::__construct()

コンストラクタ。

public void __construct ( $message, $errorInfo = [], $code '', $previous null )
$message string

PDOエラーメッセージ

$errorInfo 配列

PDOエラー情報

$code string

PDOエラーコード

$previous Throwable|null

例外チェーンに使用される前の例外。

                public function __construct($message, $errorInfo = [], $code = '', $previous = null)
{
    parent::__construct($message, 0, $previous);
    $this->errorInfo = $errorInfo;
    $this->code = $code;
}

            
__toString() public method
public string __toString ( )
戻り値 string

例外の読みやすい表現

                public function __toString()
{
    return parent::__toString() . PHP_EOL
    . 'Additional Information:' . PHP_EOL . print_r($this->errorInfo, true);
}

            
getName() public method

public string getName ( )
戻り値 string

この例外のユーザーフレンドリーな名前

                public function getName()
{
    return 'Integrity constraint violation';
}