. */ /** * ComparisonOperator = "=" | "<" | "<=" | "<>" | ">" | ">=" | "!=" * * @package Doctrine * @subpackage Query * @author Guilherme Blanco * @author Janne Vanhala * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @link http://www.phpdoctrine.org * @since 2.0 * @version $Revision$ */ class Doctrine_Query_Production_ComparisonOperator extends Doctrine_Query_Production { public function syntax($paramHolder) { switch ($this->_parser->lookahead['value']) { case '=': $this->_parser->match('='); return '='; break; case '<': $this->_parser->match('<'); $operator = '<'; if ($this->_isNextToken('=')) { $this->_parser->match('='); $operator .= '='; } elseif ($this->_isNextToken('>')) { $this->_parser->match('>'); $operator .= '>'; } return $operator; break; case '>': $this->_parser->match('>'); $operator = '>'; if ($this->_isNextToken('=')) { $this->_parser->match('='); $operator .= '='; } return $operator; break; case '!': $this->_parser->match('!'); $this->_parser->match('='); return '<>'; break; default: $this->_parser->syntaxError('=, <, <=, <>, >, >=, !='); break; } } }