final class CaseBranch
    implements Node
    uses Snapshot
Public API: explicitly declared with @visibility public.

One WHEN condition THEN result branch of a CASE expression.

In a simple CASE the condition is a value compared with the operand; in a searched CASE it is a truth value. The CASE expression derives both parts. Source: https://dev.mysql.com/doc/refman/8.4/en/flow-control-functions.html#operator_case.

Reading a branchdoctest
$query = (new \SqlSemantics\Platform\MySql\Semantics())->analyze('SELECT a FROM t WHERE CASE WHEN a THEN 1 END');
    $query->statement->where->branches[0]->result->text // => '1'

Properties§

public Scalar $condition
public Scalar $result

Methods§

public function __construct(public Scalar $condition, public Scalar $result)

Parameters

$conditionScalarThe value or condition after WHEN
$resultScalarThe result after THEN
public function render(Output $out): void

Writes WHEN, the condition, THEN and the result.

Parameters

$outOutput
Test cases 1
Calls 1

Test cases 4§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 1
Other tests reaching this symbol 3

Relations§

Instantiated in 1
Constant reads 1