Final Class yii\db\PdoValue

Inheritanceyii\db\PdoValue
Implementsyii\db\ExpressionInterface
Available since version2.0.14
Source Code https://github.com/yiisoft/yii2/blob/master/framework/db/PdoValue.php

Class PdoValue represents a $value that should be bound to PDO with exact $type.

For example, it will be useful when you need to bind binary data to BLOB column in DBMS:

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

To see possible types, check PDO::PARAM_* constants.

See also https://www.php.net/manual/en/pdostatement.bindparam.php.

Public Methods

Hide inherited methods

Method Description Defined By
__construct() PdoValue constructor. yii\db\PdoValue
getType() yii\db\PdoValue
getValue() yii\db\PdoValue

Method Details

Hide inherited methods

__construct() public method

PdoValue constructor.

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;
}