classCaseBranch
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.
$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 $conditionpublic Scalar $resultMethods§
public function __construct(public Scalar $condition, public Scalar $result)Parameters
$condition | Scalar | The value or condition after WHEN |
$result | Scalar | The result after THEN |
public function render(Output $out): voidWrites WHEN, the condition, THEN and the result.
Parameters
$out | Output |
Test cases 1
Calls 1
- method-call Output::keyword() line 41
Test cases 4§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.