0 追蹤者

Final Class yii\db\PdoValue

繼承yii\db\PdoValue
實作yii\db\ExpressionInterface
自版本起可用2.0.14
原始碼 https://github.com/yiisoft/yii2/blob/master/framework/db/PdoValue.php

PdoValue 類別代表應使用精確的 $type 繫結到 PDO 的 $value。

例如,當您需要將二進制數據繫結到 DBMS 中的 BLOB 欄位時,這將非常有用

[':name' => 'John', ':profile' => new PdoValue($profile, \PDO::PARAM_LOB)]`.

若要查看可能的類型,請查看 PDO::PARAM_* 常數

另請參閱 https://php.dev.org.tw/manual/en/pdostatement.bindparam.php

公有方法

隱藏繼承的方法

方法 描述 定義於
__construct() PdoValue 建構子。 yii\db\PdoValue
getType() yii\db\PdoValue
getValue() yii\db\PdoValue

方法詳細資訊

隱藏繼承的方法

__construct() public method

PdoValue 建構子。

public void __construct ( $value, $type )
$value
$type

                public function __construct($value, $type)
{
    $this->value = $value;
    $this->type = $type;
}

            
getType() public method

public integer getType ( )

                public function getType()
{
    return $this->type;
}

            
getValue() public method

public mixed getValue ( )

                public function getValue()
{
    return $this->value;
}