0 follower

Final Class Yiisoft\Db\Expression\Value\Param

InheritanceYiisoft\Db\Expression\Value\Param
ImplementsYiisoft\Db\Expression\ExpressionInterface

Represents a parameter used in building an SQL statement.

It can be used to represent a placeholder in an SQL statement, and can be bound to a specific value when the statement is executed.

It can also represent a column name or table name, depending on the context in which it's used. The class provides methods for specifying the parameter name, value, as well as methods for quoting and escaping the parameter value to ensure that it's handled by the database.

Public Methods

Hide inherited methods

Method Description Defined By
__construct() Yiisoft\Db\Expression\Value\Param

Property Details

Hide inherited properties

$type public property
public integer $type null
$value public property
public mixed $value null

Method Details

Hide inherited methods

__construct() public method

public mixed __construct ( mixed $value, integer $type )
$value mixed

The value to bind to the parameter.

$type integer

The SQL data type of the parameter. If null, the type is determined by the PHP type of the value.

                public function __construct(
    public readonly mixed $value,
    public readonly int $type,
) {}