0 follower

Final Class Yiisoft\Db\Expression\Statement\WhenThen

InheritanceYiisoft\Db\Expression\Statement\WhenThen

Represents the condition and the result of a WHEN-THEN clause in a SQL CASE statement.

See also Yiisoft\Db\Expression\Statement\CaseX.

Property Details

Hide inherited properties

$then public property
public mixed $then null
$when public property
public mixed $when null

Method Details

Hide inherited methods

__construct() public method

public __construct( mixed $when, mixed $then ): mixed
$when mixed

The value or condition for the WHEN-THEN clause:

$then mixed

The result to return if the condition is true. The value will be converted to its string representation using Yiisoft\Db\QueryBuilder\QueryBuilderInterface::buildValue().

                public function __construct(
    public readonly mixed $when,
    public readonly mixed $then,
) {}