. */ /** * IdentificationVariable ::= identifier * * @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_ORM_Query_Parser_IdentificationVariable extends Doctrine_ORM_Query_ParserRule { protected $_AST = null; public function syntax($paramHolder) { // IdentificationVariable ::= identifier $this->_AST = $this->AST('IdentificationVariable'); $this->_parser->match(Doctrine_ORM_Query_Token::T_IDENTIFIER); $this->_AST->setComponentAlias($this->_parser->token['value']); } public function semantical($paramHolder) { $parserResult = $this->_parser->getParserResult(); if ( ! $parserResult->hasQueryComponent($this->_AST->getComponentAlias())) { // We should throw semantical error if we cannot find the component alias $message = "No entity related to declared alias '" . $this->_AST->getComponentAlias() . "' near '" . $this->_parser->getQueryPiece($this->_parser->token) . "'."; $this->_parser->semanticalError($message); } // Return AST node return $this->_AST; } }