Doctrine\ORM\Query\Parser::ConditionalPrimary PHP Method

ConditionalPrimary() public method

ConditionalPrimary ::= SimpleConditionalExpression | "(" ConditionalExpression ")"
public ConditionalPrimary ( ) : Doctrine\ORM\Query\AST\ConditionalPrimary
return Doctrine\ORM\Query\AST\ConditionalPrimary
    public function ConditionalPrimary()
    {
        $condPrimary = new AST\ConditionalPrimary;

        if ($this->_lexer->isNextToken(Lexer::T_OPEN_PARENTHESIS)) {
            // Peek beyond the matching closing paranthesis ')'
            $peek = $this->_peekBeyondClosingParenthesis();

            if (in_array($peek['value'], array("=",  "<", "<=", "<>", ">", ">=", "!=")) ||
                    $peek['type'] === Lexer::T_NOT ||
                    $peek['type'] === Lexer::T_BETWEEN ||
                    $peek['type'] === Lexer::T_LIKE ||
                    $peek['type'] === Lexer::T_IN ||
                    $peek['type'] === Lexer::T_IS ||
                    $peek['type'] === Lexer::T_EXISTS) {
                $condPrimary->simpleConditionalExpression = $this->SimpleConditionalExpression();
            } else {
                $this->match(Lexer::T_OPEN_PARENTHESIS);
                $condPrimary->conditionalExpression = $this->ConditionalExpression();
                $this->match(Lexer::T_CLOSE_PARENTHESIS);
            }
        } else {
            $condPrimary->simpleConditionalExpression = $this->SimpleConditionalExpression();
        }

        return $condPrimary;
    }
Parser