lib/Doctrine/ORM/Query/SqlWalker.php
public function walkGeneralCaseExpression(AST\GeneralCaseExpression $generalCaseExpression)
    {
        $sql = 'CASE';

        foreach ($generalCaseExpression->whenClauses as $whenClause) {
            $sql .= ' WHEN ' . $this->walkConditionalExpression($whenClause->caseConditionExpression);
            $sql .= ' THEN ' . $this->walkSimpleArithmeticExpression($whenClause->thenScalarExpression);
        }

        $sql .= ' ELSE ' . $this->walkSimpleArithmeticExpression($generalCaseExpression->elseScalarExpression) . ' END';

        return $sql;
    }
public function walkGeneralCaseExpression(AST\GeneralCaseExpression $generalCaseExpression)
    {
        $sql = 'CASE';

        foreach ($generalCaseExpression->whenClauses as $whenClause) {
            $sql .= ' WHEN ' . $this->walkConditionalExpression($whenClause->caseConditionExpression);
            $sql .= ' THEN ' . $this->walkSimpleArithmeticExpression($whenClause->thenScalarExpression);
        }

        $sql .= ' ELSE ' . $this->walkSimpleArithmeticExpression($generalCaseExpression->elseScalarExpression) . ' END';

        return $sql;
    }
public function walkGeneralCaseExpression ( AST \ GeneralCaseExpression $ generalCaseExpression ) { $ sql = 'CASE' ; foreach ( $ generalCaseExpression -> whenClauses as $ whenClause ) { $ sql .= ' WHEN ' . $ this -> walkConditionalExpression ( $ whenClause -> caseConditionExpression ) ; $ sql .= ' THEN ' . $ this -> walkSimpleArithmeticExpression ( $ whenClause -> thenScalarExpression ) ; } $ sql .= ' ELSE ' . $ this -> walkSimpleArithmeticExpression ( $ generalCaseExpression -> elseScalarExpression ) . ' END' ; return $ sql ; }
Walks down a GeneralCaseExpression AST node and generates the corresponding SQL.

@return string The SQL.
Walks down a GeneralCaseExpression AST node and generates the corresponding SQL .