/**
  * ComparisonOperator ::= "=" | "<" | "<=" | "<>" | ">" | ">=" | "!="
  *
  * @return string
  */
 public function ComparisonOperator()
 {
     switch ($this->lexer->lookahead['value']) {
         case '=':
             $this->match(Lexer::T_EQUALS);
             return '=';
         case '<':
             $this->match(Lexer::T_LOWER_THAN);
             $operator = '<';
             if ($this->lexer->isNextToken(Lexer::T_EQUALS)) {
                 $this->match(Lexer::T_EQUALS);
                 $operator .= '=';
             } else {
                 if ($this->lexer->isNextToken(Lexer::T_GREATER_THAN)) {
                     $this->match(Lexer::T_GREATER_THAN);
                     $operator .= '>';
                 }
             }
             return $operator;
         case '>':
             $this->match(Lexer::T_GREATER_THAN);
             $operator = '>';
             if ($this->lexer->isNextToken(Lexer::T_EQUALS)) {
                 $this->match(Lexer::T_EQUALS);
                 $operator .= '=';
             }
             return $operator;
         case '!':
             $this->match(Lexer::T_NEGATE);
             $this->match(Lexer::T_EQUALS);
             return '<>';
         default:
             $this->syntaxError('=, <, <=, <>, >, >=, !=');
     }
 }
Beispiel #2
0
 /**
  * DeleteClause ::= "DELETE" ["FROM"] AbstractSchemaName ["AS"] AliasIdentificationVariable
  *
  * @return \Doctrine\ORM\Query\AST\DeleteClause
  */
 public function DeleteClause()
 {
     $this->match(Lexer::T_DELETE);
     if ($this->lexer->isNextToken(Lexer::T_FROM)) {
         $this->match(Lexer::T_FROM);
     }
     $token = $this->lexer->lookahead;
     $deleteClause = new AST\DeleteClause($this->AbstractSchemaName());
     if ($this->lexer->isNextToken(Lexer::T_AS)) {
         $this->match(Lexer::T_AS);
     }
     $aliasIdentificationVariable = $this->AliasIdentificationVariable();
     $deleteClause->aliasIdentificationVariable = $aliasIdentificationVariable;
     $class = $this->em->getClassMetadata($deleteClause->abstractSchemaName);
     // Building queryComponent
     $queryComponent = array('metadata' => $class, 'parent' => null, 'relation' => null, 'map' => null, 'nestingLevel' => $this->nestingLevel, 'token' => $token);
     $this->queryComponents[$aliasIdentificationVariable] = $queryComponent;
     return $deleteClause;
 }