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