. */ /** * IdentificationVariableDeclaration ::= RangeVariableDeclaration [IndexBy] {JoinVariableDeclaration}* * * @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 1.0 * @version $Revision$ */ class Doctrine_Query_Parser_IdentificationVariableDeclaration extends Doctrine_Query_ParserRule { protected $_AST = null; public function syntax($paramHolder) { // IdentificationVariableDeclaration ::= RangeVariableDeclaration [IndexBy] {JoinVariableDeclaration}* $this->_AST = $this->AST('IdentificationVariableDeclaration'); $this->_AST->setRangeVariableDeclaration($this->parse('RangeVariableDeclaration', $paramHolder)); if ($this->_isNextToken(Doctrine_Query_Token::T_INDEX)) { $paramHolder->set( 'componentAlias', $this->_AST->getRangeVariableDeclaration()->getAliasIdentificationVariable()->getComponentAlias() ); $this->_AST->setIndexBy($this->parse('IndexBy', $paramHolder)); $paramHolder->remove('componentAlias'); } while ( $this->_isNextToken(Doctrine_Query_Token::T_LEFT) || $this->_isNextToken(Doctrine_Query_Token::T_INNER) || $this->_isNextToken(Doctrine_Query_Token::T_JOIN) ) { $this->_AST->addJoinVariableDeclaration($this->parse('JoinVariableDeclaration', $paramHolder)); } // Return AST node return $this->_AST; } }