summaryrefslogtreecommitdiff
path: root/vendor/doctrine/orm/src/Query/AST/SimpleCaseExpression.php
blob: b3764ba1545f9b007e51736f9601f387c9156ae3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?php

declare(strict_types=1);

namespace Doctrine\ORM\Query\AST;

use Doctrine\ORM\Query\SqlWalker;

/**
 * SimpleCaseExpression ::= "CASE" CaseOperand SimpleWhenClause {SimpleWhenClause}* "ELSE" ScalarExpression "END"
 *
 * @link    www.doctrine-project.org
 */
class SimpleCaseExpression extends Node
{
    /** @param mixed[] $simpleWhenClauses */
    public function __construct(
        public PathExpression|null $caseOperand = null,
        public array $simpleWhenClauses = [],
        public mixed $elseScalarExpression = null,
    ) {
    }

    public function dispatch(SqlWalker $walker): string
    {
        return $walker->walkSimpleCaseExpression($this);
    }
}