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 |
方法詳細資訊
PdoValue 建構子。
public void __construct ( $value, $type ) | ||
$value | ||
$type |
public function __construct($value, $type)
{
$this->value = $value;
$this->type = $type;
}
註冊 或 登入 以發表評論。